datav.map.vue.js 711 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('vue')) :
  3. typeof define === 'function' && define.amd ? define(['vue'], factory) :
  4. (global = global || self, factory(global.Vue));
  5. }(this, (function (Vue) { 'use strict';
  6. Vue = Vue && Object.prototype.hasOwnProperty.call(Vue, 'default') ? Vue['default'] : Vue;
  7. function randomExtend(minNum, maxNum) {
  8. if (arguments.length === 1) {
  9. return parseInt(Math.random() * minNum + 1, 10);
  10. } else {
  11. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  12. }
  13. }
  14. function debounce(delay, callback) {
  15. let lastTime;
  16. return function () {
  17. clearTimeout(lastTime);
  18. const [that, args] = [this, arguments];
  19. lastTime = setTimeout(() => {
  20. callback.apply(that, args);
  21. }, delay);
  22. };
  23. }
  24. function observerDomResize(dom, callback) {
  25. const MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  26. const observer = new MutationObserver(callback);
  27. observer.observe(dom, {
  28. attributes: true,
  29. attributeFilter: ['style'],
  30. attributeOldValue: true
  31. });
  32. return observer;
  33. }
  34. function getPointDistance(pointOne, pointTwo) {
  35. const minusX = Math.abs(pointOne[0] - pointTwo[0]);
  36. const minusY = Math.abs(pointOne[1] - pointTwo[1]);
  37. return Math.sqrt(minusX * minusX + minusY * minusY);
  38. }
  39. function uuid(hasHyphen) {
  40. return (hasHyphen ? 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' : 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx').replace(/[xy]/g, function (c) {
  41. const r = Math.random() * 16 | 0;
  42. const v = c == 'x' ? r : r & 0x3 | 0x8;
  43. return v.toString(16);
  44. });
  45. }
  46. var autoResize = {
  47. data() {
  48. return {
  49. dom: '',
  50. width: 0,
  51. height: 0,
  52. debounceInitWHFun: '',
  53. domObserver: ''
  54. };
  55. },
  56. methods: {
  57. async autoResizeMixinInit() {
  58. const {
  59. initWH,
  60. getDebounceInitWHFun,
  61. bindDomResizeCallback,
  62. afterAutoResizeMixinInit
  63. } = this;
  64. await initWH(false);
  65. getDebounceInitWHFun();
  66. bindDomResizeCallback();
  67. if (typeof afterAutoResizeMixinInit === 'function') afterAutoResizeMixinInit();
  68. },
  69. initWH(resize = true) {
  70. const {
  71. $nextTick,
  72. $refs,
  73. ref,
  74. onResize
  75. } = this;
  76. return new Promise(resolve => {
  77. $nextTick(_ => {
  78. const dom = this.dom = $refs[ref];
  79. this.width = dom ? dom.clientWidth : 0;
  80. this.height = dom ? dom.clientHeight : 0;
  81. if (!dom) {
  82. console.warn('DataV: Failed to get dom node, component rendering may be abnormal!');
  83. } else if (!this.width || !this.height) {
  84. console.warn('DataV: Component width or height is 0px, rendering abnormality may occur!');
  85. }
  86. if (typeof onResize === 'function' && resize) onResize();
  87. resolve();
  88. });
  89. });
  90. },
  91. getDebounceInitWHFun() {
  92. const {
  93. initWH
  94. } = this;
  95. this.debounceInitWHFun = debounce(100, initWH);
  96. },
  97. bindDomResizeCallback() {
  98. const {
  99. dom,
  100. debounceInitWHFun
  101. } = this;
  102. this.domObserver = observerDomResize(dom, debounceInitWHFun);
  103. window.addEventListener('resize', debounceInitWHFun);
  104. },
  105. unbindDomResizeCallback() {
  106. let {
  107. domObserver,
  108. debounceInitWHFun
  109. } = this;
  110. if (!domObserver) return;
  111. domObserver.disconnect();
  112. domObserver.takeRecords();
  113. domObserver = null;
  114. window.removeEventListener('resize', debounceInitWHFun);
  115. }
  116. },
  117. mounted() {
  118. const {
  119. autoResizeMixinInit
  120. } = this;
  121. autoResizeMixinInit();
  122. },
  123. beforeDestroy() {
  124. const {
  125. unbindDomResizeCallback
  126. } = this;
  127. unbindDomResizeCallback();
  128. }
  129. };
  130. //
  131. var script = {
  132. name: 'DvFullScreenContainer',
  133. mixins: [autoResize],
  134. data() {
  135. return {
  136. ref: 'full-screen-container',
  137. allWidth: 0,
  138. scale: 0,
  139. datavRoot: '',
  140. ready: false
  141. };
  142. },
  143. methods: {
  144. afterAutoResizeMixinInit() {
  145. const {
  146. initConfig,
  147. setAppScale
  148. } = this;
  149. initConfig();
  150. setAppScale();
  151. this.ready = true;
  152. },
  153. initConfig() {
  154. const {
  155. dom
  156. } = this;
  157. const {
  158. width,
  159. height
  160. } = screen;
  161. this.allWidth = width;
  162. dom.style.width = `${width}px`;
  163. dom.style.height = `${height}px`;
  164. },
  165. setAppScale() {
  166. const {
  167. allWidth,
  168. dom
  169. } = this;
  170. const currentWidth = document.body.clientWidth;
  171. dom.style.transform = `scale(${currentWidth / allWidth})`;
  172. },
  173. onResize() {
  174. const {
  175. setAppScale
  176. } = this;
  177. setAppScale();
  178. }
  179. }
  180. };
  181. function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
  182. if (typeof shadowMode !== 'boolean') {
  183. createInjectorSSR = createInjector;
  184. createInjector = shadowMode;
  185. shadowMode = false;
  186. }
  187. // Vue.extend constructor export interop.
  188. const options = typeof script === 'function' ? script.options : script;
  189. // render functions
  190. if (template && template.render) {
  191. options.render = template.render;
  192. options.staticRenderFns = template.staticRenderFns;
  193. options._compiled = true;
  194. // functional template
  195. if (isFunctionalTemplate) {
  196. options.functional = true;
  197. }
  198. }
  199. // scopedId
  200. if (scopeId) {
  201. options._scopeId = scopeId;
  202. }
  203. let hook;
  204. if (moduleIdentifier) {
  205. // server build
  206. hook = function (context) {
  207. // 2.3 injection
  208. context =
  209. context || // cached call
  210. (this.$vnode && this.$vnode.ssrContext) || // stateful
  211. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
  212. // 2.2 with runInNewContext: true
  213. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  214. context = __VUE_SSR_CONTEXT__;
  215. }
  216. // inject component styles
  217. if (style) {
  218. style.call(this, createInjectorSSR(context));
  219. }
  220. // register component module identifier for async chunk inference
  221. if (context && context._registeredComponents) {
  222. context._registeredComponents.add(moduleIdentifier);
  223. }
  224. };
  225. // used by ssr in case component is cached and beforeCreate
  226. // never gets called
  227. options._ssrRegister = hook;
  228. }
  229. else if (style) {
  230. hook = shadowMode
  231. ? function (context) {
  232. style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
  233. }
  234. : function (context) {
  235. style.call(this, createInjector(context));
  236. };
  237. }
  238. if (hook) {
  239. if (options.functional) {
  240. // register for functional component in vue file
  241. const originalRender = options.render;
  242. options.render = function renderWithStyleInjection(h, context) {
  243. hook.call(context);
  244. return originalRender(h, context);
  245. };
  246. }
  247. else {
  248. // inject component registration as beforeCreate hook
  249. const existing = options.beforeCreate;
  250. options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
  251. }
  252. }
  253. return script;
  254. }
  255. const isOldIE = typeof navigator !== 'undefined' &&
  256. /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
  257. function createInjector(context) {
  258. return (id, style) => addStyle(id, style);
  259. }
  260. let HEAD;
  261. const styles = {};
  262. function addStyle(id, css) {
  263. const group = isOldIE ? css.media || 'default' : id;
  264. const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });
  265. if (!style.ids.has(id)) {
  266. style.ids.add(id);
  267. let code = css.source;
  268. if (css.map) {
  269. // https://developer.chrome.com/devtools/docs/javascript-debugging
  270. // this makes source maps inside style tags work properly in Chrome
  271. code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
  272. // http://stackoverflow.com/a/26603875
  273. code +=
  274. '\n/*# sourceMappingURL=data:application/json;base64,' +
  275. btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
  276. ' */';
  277. }
  278. if (!style.element) {
  279. style.element = document.createElement('style');
  280. style.element.type = 'text/css';
  281. if (css.media)
  282. style.element.setAttribute('media', css.media);
  283. if (HEAD === undefined) {
  284. HEAD = document.head || document.getElementsByTagName('head')[0];
  285. }
  286. HEAD.appendChild(style.element);
  287. }
  288. if ('styleSheet' in style.element) {
  289. style.styles.push(code);
  290. style.element.styleSheet.cssText = style.styles
  291. .filter(Boolean)
  292. .join('\n');
  293. }
  294. else {
  295. const index = style.ids.size - 1;
  296. const textNode = document.createTextNode(code);
  297. const nodes = style.element.childNodes;
  298. if (nodes[index])
  299. style.element.removeChild(nodes[index]);
  300. if (nodes.length)
  301. style.element.insertBefore(textNode, nodes[index]);
  302. else
  303. style.element.appendChild(textNode);
  304. }
  305. }
  306. }
  307. /* script */
  308. const __vue_script__ = script;
  309. /* template */
  310. var __vue_render__ = function() {
  311. var _vm = this;
  312. var _h = _vm.$createElement;
  313. var _c = _vm._self._c || _h;
  314. return _c(
  315. "div",
  316. { ref: _vm.ref, attrs: { id: "dv-full-screen-container" } },
  317. [_vm.ready ? [_vm._t("default")] : _vm._e()],
  318. 2
  319. )
  320. };
  321. var __vue_staticRenderFns__ = [];
  322. __vue_render__._withStripped = true;
  323. /* style */
  324. const __vue_inject_styles__ = function (inject) {
  325. if (!inject) return
  326. inject("data-v-2da16e2c_0", { source: "#dv-full-screen-container {\n position: fixed;\n top: 0px;\n left: 0px;\n overflow: hidden;\n transform-origin: left top;\n z-index: 999;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,eAAe;EACf,QAAQ;EACR,SAAS;EACT,gBAAgB;EAChB,0BAA0B;EAC1B,YAAY;AACd","file":"main.vue","sourcesContent":["#dv-full-screen-container {\n position: fixed;\n top: 0px;\n left: 0px;\n overflow: hidden;\n transform-origin: left top;\n z-index: 999;\n}\n"]}, media: undefined });
  327. };
  328. /* scoped */
  329. const __vue_scope_id__ = undefined;
  330. /* module identifier */
  331. const __vue_module_identifier__ = undefined;
  332. /* functional template */
  333. const __vue_is_functional_template__ = false;
  334. /* style inject SSR */
  335. /* style inject shadow dom */
  336. const __vue_component__ = /*#__PURE__*/normalizeComponent(
  337. { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
  338. __vue_inject_styles__,
  339. __vue_script__,
  340. __vue_scope_id__,
  341. __vue_is_functional_template__,
  342. __vue_module_identifier__,
  343. false,
  344. createInjector,
  345. undefined,
  346. undefined
  347. );
  348. function fullScreenContainer (Vue) {
  349. Vue.component(__vue_component__.name, __vue_component__);
  350. }
  351. //
  352. //
  353. //
  354. //
  355. //
  356. //
  357. //
  358. //
  359. //
  360. //
  361. //
  362. //
  363. //
  364. //
  365. //
  366. //
  367. //
  368. //
  369. //
  370. //
  371. //
  372. //
  373. //
  374. //
  375. //
  376. //
  377. //
  378. //
  379. //
  380. //
  381. //
  382. //
  383. //
  384. //
  385. //
  386. //
  387. //
  388. //
  389. //
  390. //
  391. //
  392. //
  393. //
  394. //
  395. //
  396. //
  397. //
  398. //
  399. //
  400. //
  401. //
  402. //
  403. //
  404. //
  405. //
  406. //
  407. //
  408. //
  409. //
  410. var script$1 = {
  411. name: 'DvLoading'
  412. };
  413. /* script */
  414. const __vue_script__$1 = script$1;
  415. /* template */
  416. var __vue_render__$1 = function() {
  417. var _vm = this;
  418. var _h = _vm.$createElement;
  419. var _c = _vm._self._c || _h;
  420. return _c("div", { staticClass: "dv-loading" }, [
  421. _c("svg", { attrs: { width: "50px", height: "50px" } }, [
  422. _c(
  423. "circle",
  424. {
  425. attrs: {
  426. cx: "25",
  427. cy: "25",
  428. r: "20",
  429. fill: "transparent",
  430. "stroke-width": "3",
  431. "stroke-dasharray": "31.415, 31.415",
  432. stroke: "#02bcfe",
  433. "stroke-linecap": "round"
  434. }
  435. },
  436. [
  437. _c("animateTransform", {
  438. attrs: {
  439. attributeName: "transform",
  440. type: "rotate",
  441. values: "0, 25 25;360, 25 25",
  442. dur: "1.5s",
  443. repeatCount: "indefinite"
  444. }
  445. }),
  446. _vm._v(" "),
  447. _c("animate", {
  448. attrs: {
  449. attributeName: "stroke",
  450. values: "#02bcfe;#3be6cb;#02bcfe",
  451. dur: "3s",
  452. repeatCount: "indefinite"
  453. }
  454. })
  455. ],
  456. 1
  457. ),
  458. _vm._v(" "),
  459. _c(
  460. "circle",
  461. {
  462. attrs: {
  463. cx: "25",
  464. cy: "25",
  465. r: "10",
  466. fill: "transparent",
  467. "stroke-width": "3",
  468. "stroke-dasharray": "15.7, 15.7",
  469. stroke: "#3be6cb",
  470. "stroke-linecap": "round"
  471. }
  472. },
  473. [
  474. _c("animateTransform", {
  475. attrs: {
  476. attributeName: "transform",
  477. type: "rotate",
  478. values: "360, 25 25;0, 25 25",
  479. dur: "1.5s",
  480. repeatCount: "indefinite"
  481. }
  482. }),
  483. _vm._v(" "),
  484. _c("animate", {
  485. attrs: {
  486. attributeName: "stroke",
  487. values: "#3be6cb;#02bcfe;#3be6cb",
  488. dur: "3s",
  489. repeatCount: "indefinite"
  490. }
  491. })
  492. ],
  493. 1
  494. )
  495. ]),
  496. _vm._v(" "),
  497. _c("div", { staticClass: "loading-tip" }, [_vm._t("default")], 2)
  498. ])
  499. };
  500. var __vue_staticRenderFns__$1 = [];
  501. __vue_render__$1._withStripped = true;
  502. /* style */
  503. const __vue_inject_styles__$1 = function (inject) {
  504. if (!inject) return
  505. inject("data-v-c8b3d976_0", { source: ".dv-loading {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n.dv-loading .loading-tip {\n font-size: 15px;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;EACZ,aAAa;EACb,sBAAsB;EACtB,uBAAuB;EACvB,mBAAmB;AACrB;AACA;EACE,eAAe;AACjB","file":"main.vue","sourcesContent":[".dv-loading {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n.dv-loading .loading-tip {\n font-size: 15px;\n}\n"]}, media: undefined });
  506. };
  507. /* scoped */
  508. const __vue_scope_id__$1 = undefined;
  509. /* module identifier */
  510. const __vue_module_identifier__$1 = undefined;
  511. /* functional template */
  512. const __vue_is_functional_template__$1 = false;
  513. /* style inject SSR */
  514. /* style inject shadow dom */
  515. const __vue_component__$1 = /*#__PURE__*/normalizeComponent(
  516. { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
  517. __vue_inject_styles__$1,
  518. __vue_script__$1,
  519. __vue_scope_id__$1,
  520. __vue_is_functional_template__$1,
  521. __vue_module_identifier__$1,
  522. false,
  523. createInjector,
  524. undefined,
  525. undefined
  526. );
  527. function loading (Vue) {
  528. Vue.component(__vue_component__$1.name, __vue_component__$1);
  529. }
  530. function unwrapExports (x) {
  531. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
  532. }
  533. function createCommonjsModule(fn, module) {
  534. return module = { exports: {} }, fn(module, module.exports), module.exports;
  535. }
  536. var interopRequireDefault = createCommonjsModule(function (module) {
  537. function _interopRequireDefault(obj) {
  538. return obj && obj.__esModule ? obj : {
  539. "default": obj
  540. };
  541. }
  542. module.exports = _interopRequireDefault;
  543. });
  544. unwrapExports(interopRequireDefault);
  545. function _arrayLikeToArray(arr, len) {
  546. if (len == null || len > arr.length) len = arr.length;
  547. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  548. arr2[i] = arr[i];
  549. }
  550. return arr2;
  551. }
  552. var arrayLikeToArray = _arrayLikeToArray;
  553. function _arrayWithoutHoles(arr) {
  554. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  555. }
  556. var arrayWithoutHoles = _arrayWithoutHoles;
  557. function _iterableToArray(iter) {
  558. if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
  559. }
  560. var iterableToArray = _iterableToArray;
  561. function _unsupportedIterableToArray(o, minLen) {
  562. if (!o) return;
  563. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  564. var n = Object.prototype.toString.call(o).slice(8, -1);
  565. if (n === "Object" && o.constructor) n = o.constructor.name;
  566. if (n === "Map" || n === "Set") return Array.from(o);
  567. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  568. }
  569. var unsupportedIterableToArray = _unsupportedIterableToArray;
  570. function _nonIterableSpread() {
  571. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  572. }
  573. var nonIterableSpread = _nonIterableSpread;
  574. function _toConsumableArray(arr) {
  575. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  576. }
  577. var toConsumableArray = _toConsumableArray;
  578. var _typeof_1 = createCommonjsModule(function (module) {
  579. function _typeof(obj) {
  580. "@babel/helpers - typeof";
  581. if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  582. module.exports = _typeof = function _typeof(obj) {
  583. return typeof obj;
  584. };
  585. } else {
  586. module.exports = _typeof = function _typeof(obj) {
  587. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  588. };
  589. }
  590. return _typeof(obj);
  591. }
  592. module.exports = _typeof;
  593. });
  594. function _arrayWithHoles(arr) {
  595. if (Array.isArray(arr)) return arr;
  596. }
  597. var arrayWithHoles = _arrayWithHoles;
  598. function _iterableToArrayLimit(arr, i) {
  599. if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
  600. var _arr = [];
  601. var _n = true;
  602. var _d = false;
  603. var _e = undefined;
  604. try {
  605. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  606. _arr.push(_s.value);
  607. if (i && _arr.length === i) break;
  608. }
  609. } catch (err) {
  610. _d = true;
  611. _e = err;
  612. } finally {
  613. try {
  614. if (!_n && _i["return"] != null) _i["return"]();
  615. } finally {
  616. if (_d) throw _e;
  617. }
  618. }
  619. return _arr;
  620. }
  621. var iterableToArrayLimit = _iterableToArrayLimit;
  622. function _nonIterableRest() {
  623. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  624. }
  625. var nonIterableRest = _nonIterableRest;
  626. function _slicedToArray(arr, i) {
  627. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  628. }
  629. var slicedToArray = _slicedToArray;
  630. var util = createCommonjsModule(function (module, exports) {
  631. Object.defineProperty(exports, "__esModule", {
  632. value: true
  633. });
  634. exports.deepClone = deepClone;
  635. exports.eliminateBlur = eliminateBlur;
  636. exports.checkPointIsInCircle = checkPointIsInCircle;
  637. exports.getTwoPointDistance = getTwoPointDistance;
  638. exports.checkPointIsInPolygon = checkPointIsInPolygon;
  639. exports.checkPointIsInSector = checkPointIsInSector;
  640. exports.checkPointIsNearPolyline = checkPointIsNearPolyline;
  641. exports.checkPointIsInRect = checkPointIsInRect;
  642. exports.getRotatePointPos = getRotatePointPos;
  643. exports.getScalePointPos = getScalePointPos;
  644. exports.getTranslatePointPos = getTranslatePointPos;
  645. exports.getDistanceBetweenPointAndLine = getDistanceBetweenPointAndLine;
  646. exports.getCircleRadianPoint = getCircleRadianPoint;
  647. exports.getRegularPolygonPoints = getRegularPolygonPoints;
  648. exports["default"] = void 0;
  649. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  650. var _slicedToArray2 = interopRequireDefault(slicedToArray);
  651. var _typeof2 = interopRequireDefault(_typeof_1);
  652. var abs = Math.abs,
  653. sqrt = Math.sqrt,
  654. sin = Math.sin,
  655. cos = Math.cos,
  656. max = Math.max,
  657. min = Math.min,
  658. PI = Math.PI;
  659. /**
  660. * @description Clone an object or array
  661. * @param {Object|Array} object Cloned object
  662. * @param {Boolean} recursion Whether to use recursive cloning
  663. * @return {Object|Array} Clone object
  664. */
  665. function deepClone(object) {
  666. var recursion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  667. if (!object) return object;
  668. var parse = JSON.parse,
  669. stringify = JSON.stringify;
  670. if (!recursion) return parse(stringify(object));
  671. var clonedObj = object instanceof Array ? [] : {};
  672. if (object && (0, _typeof2["default"])(object) === 'object') {
  673. for (var key in object) {
  674. if (object.hasOwnProperty(key)) {
  675. if (object[key] && (0, _typeof2["default"])(object[key]) === 'object') {
  676. clonedObj[key] = deepClone(object[key], true);
  677. } else {
  678. clonedObj[key] = object[key];
  679. }
  680. }
  681. }
  682. }
  683. return clonedObj;
  684. }
  685. /**
  686. * @description Eliminate line blur due to 1px line width
  687. * @param {Array} points Line points
  688. * @return {Array} Line points after processed
  689. */
  690. function eliminateBlur(points) {
  691. return points.map(function (_ref) {
  692. var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
  693. x = _ref2[0],
  694. y = _ref2[1];
  695. return [parseInt(x) + 0.5, parseInt(y) + 0.5];
  696. });
  697. }
  698. /**
  699. * @description Check if the point is inside the circle
  700. * @param {Array} point Postion of point
  701. * @param {Number} rx Circle x coordinate
  702. * @param {Number} ry Circle y coordinate
  703. * @param {Number} r Circle radius
  704. * @return {Boolean} Result of check
  705. */
  706. function checkPointIsInCircle(point, rx, ry, r) {
  707. return getTwoPointDistance(point, [rx, ry]) <= r;
  708. }
  709. /**
  710. * @description Get the distance between two points
  711. * @param {Array} point1 point1
  712. * @param {Array} point2 point2
  713. * @return {Number} Distance between two points
  714. */
  715. function getTwoPointDistance(_ref3, _ref4) {
  716. var _ref5 = (0, _slicedToArray2["default"])(_ref3, 2),
  717. xa = _ref5[0],
  718. ya = _ref5[1];
  719. var _ref6 = (0, _slicedToArray2["default"])(_ref4, 2),
  720. xb = _ref6[0],
  721. yb = _ref6[1];
  722. var minusX = abs(xa - xb);
  723. var minusY = abs(ya - yb);
  724. return sqrt(minusX * minusX + minusY * minusY);
  725. }
  726. /**
  727. * @description Check if the point is inside the polygon
  728. * @param {Array} point Postion of point
  729. * @param {Array} points The points that makes up a polyline
  730. * @return {Boolean} Result of check
  731. */
  732. function checkPointIsInPolygon(point, polygon) {
  733. var counter = 0;
  734. var _point = (0, _slicedToArray2["default"])(point, 2),
  735. x = _point[0],
  736. y = _point[1];
  737. var pointNum = polygon.length;
  738. for (var i = 1, p1 = polygon[0]; i <= pointNum; i++) {
  739. var p2 = polygon[i % pointNum];
  740. if (x > min(p1[0], p2[0]) && x <= max(p1[0], p2[0])) {
  741. if (y <= max(p1[1], p2[1])) {
  742. if (p1[0] !== p2[0]) {
  743. var xinters = (x - p1[0]) * (p2[1] - p1[1]) / (p2[0] - p1[0]) + p1[1];
  744. if (p1[1] === p2[1] || y <= xinters) {
  745. counter++;
  746. }
  747. }
  748. }
  749. }
  750. p1 = p2;
  751. }
  752. return counter % 2 === 1;
  753. }
  754. /**
  755. * @description Check if the point is inside the sector
  756. * @param {Array} point Postion of point
  757. * @param {Number} rx Sector x coordinate
  758. * @param {Number} ry Sector y coordinate
  759. * @param {Number} r Sector radius
  760. * @param {Number} startAngle Sector start angle
  761. * @param {Number} endAngle Sector end angle
  762. * @param {Boolean} clockWise Whether the sector angle is clockwise
  763. * @return {Boolean} Result of check
  764. */
  765. function checkPointIsInSector(point, rx, ry, r, startAngle, endAngle, clockWise) {
  766. if (!point) return false;
  767. if (getTwoPointDistance(point, [rx, ry]) > r) return false;
  768. if (!clockWise) {
  769. var _deepClone = deepClone([endAngle, startAngle]);
  770. var _deepClone2 = (0, _slicedToArray2["default"])(_deepClone, 2);
  771. startAngle = _deepClone2[0];
  772. endAngle = _deepClone2[1];
  773. }
  774. var reverseBE = startAngle > endAngle;
  775. if (reverseBE) {
  776. var _ref7 = [endAngle, startAngle];
  777. startAngle = _ref7[0];
  778. endAngle = _ref7[1];
  779. }
  780. var minus = endAngle - startAngle;
  781. if (minus >= PI * 2) return true;
  782. var _point2 = (0, _slicedToArray2["default"])(point, 2),
  783. x = _point2[0],
  784. y = _point2[1];
  785. var _getCircleRadianPoint = getCircleRadianPoint(rx, ry, r, startAngle),
  786. _getCircleRadianPoint2 = (0, _slicedToArray2["default"])(_getCircleRadianPoint, 2),
  787. bx = _getCircleRadianPoint2[0],
  788. by = _getCircleRadianPoint2[1];
  789. var _getCircleRadianPoint3 = getCircleRadianPoint(rx, ry, r, endAngle),
  790. _getCircleRadianPoint4 = (0, _slicedToArray2["default"])(_getCircleRadianPoint3, 2),
  791. ex = _getCircleRadianPoint4[0],
  792. ey = _getCircleRadianPoint4[1];
  793. var vPoint = [x - rx, y - ry];
  794. var vBArm = [bx - rx, by - ry];
  795. var vEArm = [ex - rx, ey - ry];
  796. var reverse = minus > PI;
  797. if (reverse) {
  798. var _deepClone3 = deepClone([vEArm, vBArm]);
  799. var _deepClone4 = (0, _slicedToArray2["default"])(_deepClone3, 2);
  800. vBArm = _deepClone4[0];
  801. vEArm = _deepClone4[1];
  802. }
  803. var inSector = isClockWise(vBArm, vPoint) && !isClockWise(vEArm, vPoint);
  804. if (reverse) inSector = !inSector;
  805. if (reverseBE) inSector = !inSector;
  806. return inSector;
  807. }
  808. /**
  809. * @description Determine if the point is in the clockwise direction of the vector
  810. * @param {Array} vArm Vector
  811. * @param {Array} vPoint Point
  812. * @return {Boolean} Result of check
  813. */
  814. function isClockWise(vArm, vPoint) {
  815. var _vArm = (0, _slicedToArray2["default"])(vArm, 2),
  816. ax = _vArm[0],
  817. ay = _vArm[1];
  818. var _vPoint = (0, _slicedToArray2["default"])(vPoint, 2),
  819. px = _vPoint[0],
  820. py = _vPoint[1];
  821. return -ay * px + ax * py > 0;
  822. }
  823. /**
  824. * @description Check if the point is inside the polyline
  825. * @param {Array} point Postion of point
  826. * @param {Array} polyline The points that makes up a polyline
  827. * @param {Number} lineWidth Polyline linewidth
  828. * @return {Boolean} Result of check
  829. */
  830. function checkPointIsNearPolyline(point, polyline, lineWidth) {
  831. var halfLineWidth = lineWidth / 2;
  832. var moveUpPolyline = polyline.map(function (_ref8) {
  833. var _ref9 = (0, _slicedToArray2["default"])(_ref8, 2),
  834. x = _ref9[0],
  835. y = _ref9[1];
  836. return [x, y - halfLineWidth];
  837. });
  838. var moveDownPolyline = polyline.map(function (_ref10) {
  839. var _ref11 = (0, _slicedToArray2["default"])(_ref10, 2),
  840. x = _ref11[0],
  841. y = _ref11[1];
  842. return [x, y + halfLineWidth];
  843. });
  844. var polygon = [].concat((0, _toConsumableArray2["default"])(moveUpPolyline), (0, _toConsumableArray2["default"])(moveDownPolyline.reverse()));
  845. return checkPointIsInPolygon(point, polygon);
  846. }
  847. /**
  848. * @description Check if the point is inside the rect
  849. * @param {Array} point Postion of point
  850. * @param {Number} x Rect start x coordinate
  851. * @param {Number} y Rect start y coordinate
  852. * @param {Number} width Rect width
  853. * @param {Number} height Rect height
  854. * @return {Boolean} Result of check
  855. */
  856. function checkPointIsInRect(_ref12, x, y, width, height) {
  857. var _ref13 = (0, _slicedToArray2["default"])(_ref12, 2),
  858. px = _ref13[0],
  859. py = _ref13[1];
  860. if (px < x) return false;
  861. if (py < y) return false;
  862. if (px > x + width) return false;
  863. if (py > y + height) return false;
  864. return true;
  865. }
  866. /**
  867. * @description Get the coordinates of the rotated point
  868. * @param {Number} rotate Degree of rotation
  869. * @param {Array} point Postion of point
  870. * @param {Array} origin Rotation center
  871. * @param {Array} origin Rotation center
  872. * @return {Number} Coordinates after rotation
  873. */
  874. function getRotatePointPos() {
  875. var rotate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  876. var point = arguments.length > 1 ? arguments[1] : undefined;
  877. var origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0];
  878. if (!point) return false;
  879. if (rotate % 360 === 0) return point;
  880. var _point3 = (0, _slicedToArray2["default"])(point, 2),
  881. x = _point3[0],
  882. y = _point3[1];
  883. var _origin = (0, _slicedToArray2["default"])(origin, 2),
  884. ox = _origin[0],
  885. oy = _origin[1];
  886. rotate *= PI / 180;
  887. return [(x - ox) * cos(rotate) - (y - oy) * sin(rotate) + ox, (x - ox) * sin(rotate) + (y - oy) * cos(rotate) + oy];
  888. }
  889. /**
  890. * @description Get the coordinates of the scaled point
  891. * @param {Array} scale Scale factor
  892. * @param {Array} point Postion of point
  893. * @param {Array} origin Scale center
  894. * @return {Number} Coordinates after scale
  895. */
  896. function getScalePointPos() {
  897. var scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [1, 1];
  898. var point = arguments.length > 1 ? arguments[1] : undefined;
  899. var origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0];
  900. if (!point) return false;
  901. if (scale === 1) return point;
  902. var _point4 = (0, _slicedToArray2["default"])(point, 2),
  903. x = _point4[0],
  904. y = _point4[1];
  905. var _origin2 = (0, _slicedToArray2["default"])(origin, 2),
  906. ox = _origin2[0],
  907. oy = _origin2[1];
  908. var _scale = (0, _slicedToArray2["default"])(scale, 2),
  909. xs = _scale[0],
  910. ys = _scale[1];
  911. var relativePosX = x - ox;
  912. var relativePosY = y - oy;
  913. return [relativePosX * xs + ox, relativePosY * ys + oy];
  914. }
  915. /**
  916. * @description Get the coordinates of the scaled point
  917. * @param {Array} translate Translation distance
  918. * @param {Array} point Postion of point
  919. * @return {Number} Coordinates after translation
  920. */
  921. function getTranslatePointPos(translate, point) {
  922. if (!translate || !point) return false;
  923. var _point5 = (0, _slicedToArray2["default"])(point, 2),
  924. x = _point5[0],
  925. y = _point5[1];
  926. var _translate = (0, _slicedToArray2["default"])(translate, 2),
  927. tx = _translate[0],
  928. ty = _translate[1];
  929. return [x + tx, y + ty];
  930. }
  931. /**
  932. * @description Get the distance from the point to the line
  933. * @param {Array} point Postion of point
  934. * @param {Array} lineBegin Line start position
  935. * @param {Array} lineEnd Line end position
  936. * @return {Number} Distance between point and line
  937. */
  938. function getDistanceBetweenPointAndLine(point, lineBegin, lineEnd) {
  939. if (!point || !lineBegin || !lineEnd) return false;
  940. var _point6 = (0, _slicedToArray2["default"])(point, 2),
  941. x = _point6[0],
  942. y = _point6[1];
  943. var _lineBegin = (0, _slicedToArray2["default"])(lineBegin, 2),
  944. x1 = _lineBegin[0],
  945. y1 = _lineBegin[1];
  946. var _lineEnd = (0, _slicedToArray2["default"])(lineEnd, 2),
  947. x2 = _lineEnd[0],
  948. y2 = _lineEnd[1];
  949. var a = y2 - y1;
  950. var b = x1 - x2;
  951. var c = y1 * (x2 - x1) - x1 * (y2 - y1);
  952. var molecule = abs(a * x + b * y + c);
  953. var denominator = sqrt(a * a + b * b);
  954. return molecule / denominator;
  955. }
  956. /**
  957. * @description Get the coordinates of the specified radian on the circle
  958. * @param {Number} x Circle x coordinate
  959. * @param {Number} y Circle y coordinate
  960. * @param {Number} radius Circle radius
  961. * @param {Number} radian Specfied radian
  962. * @return {Array} Postion of point
  963. */
  964. function getCircleRadianPoint(x, y, radius, radian) {
  965. return [x + cos(radian) * radius, y + sin(radian) * radius];
  966. }
  967. /**
  968. * @description Get the points that make up a regular polygon
  969. * @param {Number} x X coordinate of the polygon inscribed circle
  970. * @param {Number} y Y coordinate of the polygon inscribed circle
  971. * @param {Number} r Radius of the polygon inscribed circle
  972. * @param {Number} side Side number
  973. * @param {Number} minus Radian offset
  974. * @return {Array} Points that make up a regular polygon
  975. */
  976. function getRegularPolygonPoints(rx, ry, r, side) {
  977. var minus = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : PI * -0.5;
  978. var radianGap = PI * 2 / side;
  979. var radians = new Array(side).fill('').map(function (t, i) {
  980. return i * radianGap + minus;
  981. });
  982. return radians.map(function (radian) {
  983. return getCircleRadianPoint(rx, ry, r, radian);
  984. });
  985. }
  986. var _default = {
  987. deepClone: deepClone,
  988. eliminateBlur: eliminateBlur,
  989. checkPointIsInCircle: checkPointIsInCircle,
  990. checkPointIsInPolygon: checkPointIsInPolygon,
  991. checkPointIsInSector: checkPointIsInSector,
  992. checkPointIsNearPolyline: checkPointIsNearPolyline,
  993. getTwoPointDistance: getTwoPointDistance,
  994. getRotatePointPos: getRotatePointPos,
  995. getScalePointPos: getScalePointPos,
  996. getTranslatePointPos: getTranslatePointPos,
  997. getCircleRadianPoint: getCircleRadianPoint,
  998. getRegularPolygonPoints: getRegularPolygonPoints,
  999. getDistanceBetweenPointAndLine: getDistanceBetweenPointAndLine
  1000. };
  1001. exports["default"] = _default;
  1002. });
  1003. unwrapExports(util);
  1004. var util_1 = util.deepClone;
  1005. var util_2 = util.eliminateBlur;
  1006. var util_3 = util.checkPointIsInCircle;
  1007. var util_4 = util.getTwoPointDistance;
  1008. var util_5 = util.checkPointIsInPolygon;
  1009. var util_6 = util.checkPointIsInSector;
  1010. var util_7 = util.checkPointIsNearPolyline;
  1011. var util_8 = util.checkPointIsInRect;
  1012. var util_9 = util.getRotatePointPos;
  1013. var util_10 = util.getScalePointPos;
  1014. var util_11 = util.getTranslatePointPos;
  1015. var util_12 = util.getDistanceBetweenPointAndLine;
  1016. var util_13 = util.getCircleRadianPoint;
  1017. var util_14 = util.getRegularPolygonPoints;
  1018. var util$1 = createCommonjsModule(function (module, exports) {
  1019. Object.defineProperty(exports, "__esModule", {
  1020. value: true
  1021. });
  1022. exports.filterNonNumber = filterNonNumber;
  1023. exports.deepMerge = deepMerge;
  1024. exports.mulAdd = mulAdd;
  1025. exports.mergeSameStackData = mergeSameStackData;
  1026. exports.getTwoPointDistance = getTwoPointDistance;
  1027. exports.getLinearGradientColor = getLinearGradientColor;
  1028. exports.getPolylineLength = getPolylineLength;
  1029. exports.getPointToLineDistance = getPointToLineDistance;
  1030. exports.initNeedSeries = initNeedSeries;
  1031. exports.radianToAngle = radianToAngle;
  1032. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  1033. var _typeof2 = interopRequireDefault(_typeof_1);
  1034. function filterNonNumber(array) {
  1035. return array.filter(function (n) {
  1036. return typeof n === 'number';
  1037. });
  1038. }
  1039. function deepMerge(target, merged) {
  1040. for (var key in merged) {
  1041. if (target[key] && (0, _typeof2["default"])(target[key]) === 'object') {
  1042. deepMerge(target[key], merged[key]);
  1043. continue;
  1044. }
  1045. if ((0, _typeof2["default"])(merged[key]) === 'object') {
  1046. target[key] = (0, util.deepClone)(merged[key], true);
  1047. continue;
  1048. }
  1049. target[key] = merged[key];
  1050. }
  1051. return target;
  1052. }
  1053. function mulAdd(nums) {
  1054. nums = filterNonNumber(nums);
  1055. return nums.reduce(function (all, num) {
  1056. return all + num;
  1057. }, 0);
  1058. }
  1059. function mergeSameStackData(item, series) {
  1060. var stack = item.stack;
  1061. if (!stack) return (0, _toConsumableArray2["default"])(item.data);
  1062. var stacks = series.filter(function (_ref) {
  1063. var s = _ref.stack;
  1064. return s === stack;
  1065. });
  1066. var index = stacks.findIndex(function (_ref2) {
  1067. var d = _ref2.data;
  1068. return d === item.data;
  1069. });
  1070. var datas = stacks.splice(0, index + 1).map(function (_ref3) {
  1071. var data = _ref3.data;
  1072. return data;
  1073. });
  1074. var dataLength = datas[0].length;
  1075. return new Array(dataLength).fill(0).map(function (foo, i) {
  1076. return mulAdd(datas.map(function (d) {
  1077. return d[i];
  1078. }));
  1079. });
  1080. }
  1081. function getTwoPointDistance(pointOne, pointTwo) {
  1082. var minusX = Math.abs(pointOne[0] - pointTwo[0]);
  1083. var minusY = Math.abs(pointOne[1] - pointTwo[1]);
  1084. return Math.sqrt(minusX * minusX + minusY * minusY);
  1085. }
  1086. function getLinearGradientColor(ctx, begin, end, color) {
  1087. if (!ctx || !begin || !end || !color.length) return;
  1088. var colors = color;
  1089. typeof colors === 'string' && (colors = [color, color]);
  1090. var linearGradientColor = ctx.createLinearGradient.apply(ctx, (0, _toConsumableArray2["default"])(begin).concat((0, _toConsumableArray2["default"])(end)));
  1091. var colorGap = 1 / (colors.length - 1);
  1092. colors.forEach(function (c, i) {
  1093. return linearGradientColor.addColorStop(colorGap * i, c);
  1094. });
  1095. return linearGradientColor;
  1096. }
  1097. function getPolylineLength(points) {
  1098. var lineSegments = new Array(points.length - 1).fill(0).map(function (foo, i) {
  1099. return [points[i], points[i + 1]];
  1100. });
  1101. var lengths = lineSegments.map(function (item) {
  1102. return getTwoPointDistance.apply(void 0, (0, _toConsumableArray2["default"])(item));
  1103. });
  1104. return mulAdd(lengths);
  1105. }
  1106. function getPointToLineDistance(point, linePointOne, linePointTwo) {
  1107. var a = getTwoPointDistance(point, linePointOne);
  1108. var b = getTwoPointDistance(point, linePointTwo);
  1109. var c = getTwoPointDistance(linePointOne, linePointTwo);
  1110. return 0.5 * Math.sqrt((a + b + c) * (a + b - c) * (a + c - b) * (b + c - a)) / c;
  1111. }
  1112. function initNeedSeries(series, config, type) {
  1113. series = series.filter(function (_ref4) {
  1114. var st = _ref4.type;
  1115. return st === type;
  1116. });
  1117. series = series.map(function (item) {
  1118. return deepMerge((0, util.deepClone)(config, true), item);
  1119. });
  1120. return series.filter(function (_ref5) {
  1121. var show = _ref5.show;
  1122. return show;
  1123. });
  1124. }
  1125. function radianToAngle(radian) {
  1126. return radian / Math.PI * 180;
  1127. }
  1128. });
  1129. unwrapExports(util$1);
  1130. var util_1$1 = util$1.filterNonNumber;
  1131. var util_2$1 = util$1.deepMerge;
  1132. var util_3$1 = util$1.mulAdd;
  1133. var util_4$1 = util$1.mergeSameStackData;
  1134. var util_5$1 = util$1.getTwoPointDistance;
  1135. var util_6$1 = util$1.getLinearGradientColor;
  1136. var util_7$1 = util$1.getPolylineLength;
  1137. var util_8$1 = util$1.getPointToLineDistance;
  1138. var util_9$1 = util$1.initNeedSeries;
  1139. var util_10$1 = util$1.radianToAngle;
  1140. //
  1141. var script$2 = {
  1142. name: 'DvBorderBox1',
  1143. mixins: [autoResize],
  1144. props: {
  1145. color: {
  1146. type: Array,
  1147. default: () => []
  1148. },
  1149. backgroundColor: {
  1150. type: String,
  1151. default: 'transparent'
  1152. }
  1153. },
  1154. data() {
  1155. return {
  1156. ref: 'border-box-1',
  1157. border: ['left-top', 'right-top', 'left-bottom', 'right-bottom'],
  1158. defaultColor: ['#4fd2dd', '#235fa7'],
  1159. mergedColor: []
  1160. };
  1161. },
  1162. watch: {
  1163. color() {
  1164. const {
  1165. mergeColor
  1166. } = this;
  1167. mergeColor();
  1168. }
  1169. },
  1170. methods: {
  1171. mergeColor() {
  1172. const {
  1173. color,
  1174. defaultColor
  1175. } = this;
  1176. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  1177. }
  1178. },
  1179. mounted() {
  1180. const {
  1181. mergeColor
  1182. } = this;
  1183. mergeColor();
  1184. }
  1185. };
  1186. /* script */
  1187. const __vue_script__$2 = script$2;
  1188. /* template */
  1189. var __vue_render__$2 = function() {
  1190. var _vm = this;
  1191. var _h = _vm.$createElement;
  1192. var _c = _vm._self._c || _h;
  1193. return _c(
  1194. "div",
  1195. { ref: _vm.ref, staticClass: "dv-border-box-1" },
  1196. [
  1197. _c(
  1198. "svg",
  1199. {
  1200. staticClass: "border",
  1201. attrs: { width: _vm.width, height: _vm.height }
  1202. },
  1203. [
  1204. _c("polygon", {
  1205. attrs: {
  1206. fill: _vm.backgroundColor,
  1207. points:
  1208. "10, 27 10, " +
  1209. (_vm.height - 27) +
  1210. " 13, " +
  1211. (_vm.height - 24) +
  1212. " 13, " +
  1213. (_vm.height - 21) +
  1214. " 24, " +
  1215. (_vm.height - 11) +
  1216. "\n 38, " +
  1217. (_vm.height - 11) +
  1218. " 41, " +
  1219. (_vm.height - 8) +
  1220. " 73, " +
  1221. (_vm.height - 8) +
  1222. " 75, " +
  1223. (_vm.height - 10) +
  1224. " 81, " +
  1225. (_vm.height - 10) +
  1226. "\n 85, " +
  1227. (_vm.height - 6) +
  1228. " " +
  1229. (_vm.width - 85) +
  1230. ", " +
  1231. (_vm.height - 6) +
  1232. " " +
  1233. (_vm.width - 81) +
  1234. ", " +
  1235. (_vm.height - 10) +
  1236. " " +
  1237. (_vm.width - 75) +
  1238. ", " +
  1239. (_vm.height - 10) +
  1240. "\n " +
  1241. (_vm.width - 73) +
  1242. ", " +
  1243. (_vm.height - 8) +
  1244. " " +
  1245. (_vm.width - 41) +
  1246. ", " +
  1247. (_vm.height - 8) +
  1248. " " +
  1249. (_vm.width - 38) +
  1250. ", " +
  1251. (_vm.height - 11) +
  1252. "\n " +
  1253. (_vm.width - 24) +
  1254. ", " +
  1255. (_vm.height - 11) +
  1256. " " +
  1257. (_vm.width - 13) +
  1258. ", " +
  1259. (_vm.height - 21) +
  1260. " " +
  1261. (_vm.width - 13) +
  1262. ", " +
  1263. (_vm.height - 24) +
  1264. "\n " +
  1265. (_vm.width - 10) +
  1266. ", " +
  1267. (_vm.height - 27) +
  1268. " " +
  1269. (_vm.width - 10) +
  1270. ", 27 " +
  1271. (_vm.width - 13) +
  1272. ", 25 " +
  1273. (_vm.width - 13) +
  1274. ", 21\n " +
  1275. (_vm.width - 24) +
  1276. ", 11 " +
  1277. (_vm.width - 38) +
  1278. ", 11 " +
  1279. (_vm.width - 41) +
  1280. ", 8 " +
  1281. (_vm.width - 73) +
  1282. ", 8 " +
  1283. (_vm.width - 75) +
  1284. ", 10\n " +
  1285. (_vm.width - 81) +
  1286. ", 10 " +
  1287. (_vm.width - 85) +
  1288. ", 6 85, 6 81, 10 75, 10 73, 8 41, 8 38, 11 24, 11 13, 21 13, 24"
  1289. }
  1290. })
  1291. ]
  1292. ),
  1293. _vm._v(" "),
  1294. _vm._l(_vm.border, function(item) {
  1295. return _c(
  1296. "svg",
  1297. {
  1298. key: item,
  1299. class: item + " border",
  1300. attrs: { width: "150px", height: "150px" }
  1301. },
  1302. [
  1303. _c(
  1304. "polygon",
  1305. {
  1306. attrs: {
  1307. fill: _vm.mergedColor[0],
  1308. points:
  1309. "6,66 6,18 12,12 18,12 24,6 27,6 30,9 36,9 39,6 84,6 81,9 75,9 73.2,7 40.8,7 37.8,10.2 24,10.2 12,21 12,24 9,27 9,51 7.8,54 7.8,63"
  1310. }
  1311. },
  1312. [
  1313. _c("animate", {
  1314. attrs: {
  1315. attributeName: "fill",
  1316. values:
  1317. _vm.mergedColor[0] +
  1318. ";" +
  1319. _vm.mergedColor[1] +
  1320. ";" +
  1321. _vm.mergedColor[0],
  1322. dur: "0.5s",
  1323. begin: "0s",
  1324. repeatCount: "indefinite"
  1325. }
  1326. })
  1327. ]
  1328. ),
  1329. _vm._v(" "),
  1330. _c(
  1331. "polygon",
  1332. {
  1333. attrs: {
  1334. fill: _vm.mergedColor[1],
  1335. points:
  1336. "27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8"
  1337. }
  1338. },
  1339. [
  1340. _c("animate", {
  1341. attrs: {
  1342. attributeName: "fill",
  1343. values:
  1344. _vm.mergedColor[1] +
  1345. ";" +
  1346. _vm.mergedColor[0] +
  1347. ";" +
  1348. _vm.mergedColor[1],
  1349. dur: "0.5s",
  1350. begin: "0s",
  1351. repeatCount: "indefinite"
  1352. }
  1353. })
  1354. ]
  1355. ),
  1356. _vm._v(" "),
  1357. _c(
  1358. "polygon",
  1359. {
  1360. attrs: {
  1361. fill: _vm.mergedColor[0],
  1362. points:
  1363. "9,54 9,63 7.199999999999999,66 7.199999999999999,75 7.8,78 7.8,110 8.4,110 8.4,66 9.6,66 9.6,54"
  1364. }
  1365. },
  1366. [
  1367. _c("animate", {
  1368. attrs: {
  1369. attributeName: "fill",
  1370. values:
  1371. _vm.mergedColor[0] +
  1372. ";" +
  1373. _vm.mergedColor[1] +
  1374. ";transparent",
  1375. dur: "1s",
  1376. begin: "0s",
  1377. repeatCount: "indefinite"
  1378. }
  1379. })
  1380. ]
  1381. )
  1382. ]
  1383. )
  1384. }),
  1385. _vm._v(" "),
  1386. _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
  1387. ],
  1388. 2
  1389. )
  1390. };
  1391. var __vue_staticRenderFns__$2 = [];
  1392. __vue_render__$2._withStripped = true;
  1393. /* style */
  1394. const __vue_inject_styles__$2 = function (inject) {
  1395. if (!inject) return
  1396. inject("data-v-5d85361d_0", { source: ".dv-border-box-1 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-1 .border {\n position: absolute;\n display: block;\n}\n.dv-border-box-1 .right-top {\n right: 0px;\n transform: rotateY(180deg);\n}\n.dv-border-box-1 .left-bottom {\n bottom: 0px;\n transform: rotateX(180deg);\n}\n.dv-border-box-1 .right-bottom {\n right: 0px;\n bottom: 0px;\n transform: rotateX(180deg) rotateY(180deg);\n}\n.dv-border-box-1 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,cAAc;AAChB;AACA;EACE,UAAU;EACV,0BAA0B;AAC5B;AACA;EACE,WAAW;EACX,0BAA0B;AAC5B;AACA;EACE,UAAU;EACV,WAAW;EACX,0CAA0C;AAC5C;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-1 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-1 .border {\n position: absolute;\n display: block;\n}\n.dv-border-box-1 .right-top {\n right: 0px;\n transform: rotateY(180deg);\n}\n.dv-border-box-1 .left-bottom {\n bottom: 0px;\n transform: rotateX(180deg);\n}\n.dv-border-box-1 .right-bottom {\n right: 0px;\n bottom: 0px;\n transform: rotateX(180deg) rotateY(180deg);\n}\n.dv-border-box-1 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  1397. };
  1398. /* scoped */
  1399. const __vue_scope_id__$2 = undefined;
  1400. /* module identifier */
  1401. const __vue_module_identifier__$2 = undefined;
  1402. /* functional template */
  1403. const __vue_is_functional_template__$2 = false;
  1404. /* style inject SSR */
  1405. /* style inject shadow dom */
  1406. const __vue_component__$2 = /*#__PURE__*/normalizeComponent(
  1407. { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
  1408. __vue_inject_styles__$2,
  1409. __vue_script__$2,
  1410. __vue_scope_id__$2,
  1411. __vue_is_functional_template__$2,
  1412. __vue_module_identifier__$2,
  1413. false,
  1414. createInjector,
  1415. undefined,
  1416. undefined
  1417. );
  1418. function borderBox1 (Vue) {
  1419. Vue.component(__vue_component__$2.name, __vue_component__$2);
  1420. }
  1421. //
  1422. var script$3 = {
  1423. name: 'DvBorderBox2',
  1424. mixins: [autoResize],
  1425. props: {
  1426. color: {
  1427. type: Array,
  1428. default: () => []
  1429. },
  1430. backgroundColor: {
  1431. type: String,
  1432. default: 'transparent'
  1433. }
  1434. },
  1435. data() {
  1436. return {
  1437. ref: 'border-box-2',
  1438. defaultColor: ['#fff', 'rgba(255, 255, 255, 0.6)'],
  1439. mergedColor: []
  1440. };
  1441. },
  1442. watch: {
  1443. color() {
  1444. const {
  1445. mergeColor
  1446. } = this;
  1447. mergeColor();
  1448. }
  1449. },
  1450. methods: {
  1451. mergeColor() {
  1452. const {
  1453. color,
  1454. defaultColor
  1455. } = this;
  1456. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  1457. }
  1458. },
  1459. mounted() {
  1460. const {
  1461. mergeColor
  1462. } = this;
  1463. mergeColor();
  1464. }
  1465. };
  1466. /* script */
  1467. const __vue_script__$3 = script$3;
  1468. /* template */
  1469. var __vue_render__$3 = function() {
  1470. var _vm = this;
  1471. var _h = _vm.$createElement;
  1472. var _c = _vm._self._c || _h;
  1473. return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-2" }, [
  1474. _c(
  1475. "svg",
  1476. {
  1477. staticClass: "dv-border-svg-container",
  1478. attrs: { width: _vm.width, height: _vm.height }
  1479. },
  1480. [
  1481. _c("polygon", {
  1482. attrs: {
  1483. fill: _vm.backgroundColor,
  1484. points:
  1485. "\n 7, 7 " +
  1486. (_vm.width - 7) +
  1487. ", 7 " +
  1488. (_vm.width - 7) +
  1489. ", " +
  1490. (_vm.height - 7) +
  1491. " 7, " +
  1492. (_vm.height - 7) +
  1493. "\n "
  1494. }
  1495. }),
  1496. _vm._v(" "),
  1497. _c("polyline", {
  1498. attrs: {
  1499. stroke: _vm.mergedColor[0],
  1500. points:
  1501. "2, 2 " +
  1502. (_vm.width - 2) +
  1503. " ,2 " +
  1504. (_vm.width - 2) +
  1505. ", " +
  1506. (_vm.height - 2) +
  1507. " 2, " +
  1508. (_vm.height - 2) +
  1509. " 2, 2"
  1510. }
  1511. }),
  1512. _vm._v(" "),
  1513. _c("polyline", {
  1514. attrs: {
  1515. stroke: _vm.mergedColor[1],
  1516. points:
  1517. "6, 6 " +
  1518. (_vm.width - 6) +
  1519. ", 6 " +
  1520. (_vm.width - 6) +
  1521. ", " +
  1522. (_vm.height - 6) +
  1523. " 6, " +
  1524. (_vm.height - 6) +
  1525. " 6, 6"
  1526. }
  1527. }),
  1528. _vm._v(" "),
  1529. _c("circle", {
  1530. attrs: { fill: _vm.mergedColor[0], cx: "11", cy: "11", r: "1" }
  1531. }),
  1532. _vm._v(" "),
  1533. _c("circle", {
  1534. attrs: {
  1535. fill: _vm.mergedColor[0],
  1536. cx: _vm.width - 11,
  1537. cy: "11",
  1538. r: "1"
  1539. }
  1540. }),
  1541. _vm._v(" "),
  1542. _c("circle", {
  1543. attrs: {
  1544. fill: _vm.mergedColor[0],
  1545. cx: _vm.width - 11,
  1546. cy: _vm.height - 11,
  1547. r: "1"
  1548. }
  1549. }),
  1550. _vm._v(" "),
  1551. _c("circle", {
  1552. attrs: {
  1553. fill: _vm.mergedColor[0],
  1554. cx: "11",
  1555. cy: _vm.height - 11,
  1556. r: "1"
  1557. }
  1558. })
  1559. ]
  1560. ),
  1561. _vm._v(" "),
  1562. _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
  1563. ])
  1564. };
  1565. var __vue_staticRenderFns__$3 = [];
  1566. __vue_render__$3._withStripped = true;
  1567. /* style */
  1568. const __vue_inject_styles__$3 = function (inject) {
  1569. if (!inject) return
  1570. inject("data-v-d5c64680_0", { source: ".dv-border-box-2 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-2 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-2 .dv-border-svg-container > polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-2 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,UAAU;EACV,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-2 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-2 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-2 .dv-border-svg-container > polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-2 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  1571. };
  1572. /* scoped */
  1573. const __vue_scope_id__$3 = undefined;
  1574. /* module identifier */
  1575. const __vue_module_identifier__$3 = undefined;
  1576. /* functional template */
  1577. const __vue_is_functional_template__$3 = false;
  1578. /* style inject SSR */
  1579. /* style inject shadow dom */
  1580. const __vue_component__$3 = /*#__PURE__*/normalizeComponent(
  1581. { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },
  1582. __vue_inject_styles__$3,
  1583. __vue_script__$3,
  1584. __vue_scope_id__$3,
  1585. __vue_is_functional_template__$3,
  1586. __vue_module_identifier__$3,
  1587. false,
  1588. createInjector,
  1589. undefined,
  1590. undefined
  1591. );
  1592. function borderBox2 (Vue) {
  1593. Vue.component(__vue_component__$3.name, __vue_component__$3);
  1594. }
  1595. //
  1596. var script$4 = {
  1597. name: 'DvBorderBox3',
  1598. mixins: [autoResize],
  1599. props: {
  1600. color: {
  1601. type: Array,
  1602. default: () => []
  1603. },
  1604. backgroundColor: {
  1605. type: String,
  1606. default: 'transparent'
  1607. }
  1608. },
  1609. data() {
  1610. return {
  1611. ref: 'border-box-3',
  1612. defaultColor: ['#2862b7', '#2862b7'],
  1613. mergedColor: []
  1614. };
  1615. },
  1616. watch: {
  1617. color() {
  1618. const {
  1619. mergeColor
  1620. } = this;
  1621. mergeColor();
  1622. }
  1623. },
  1624. methods: {
  1625. mergeColor() {
  1626. const {
  1627. color,
  1628. defaultColor
  1629. } = this;
  1630. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  1631. }
  1632. },
  1633. mounted() {
  1634. const {
  1635. mergeColor
  1636. } = this;
  1637. mergeColor();
  1638. }
  1639. };
  1640. /* script */
  1641. const __vue_script__$4 = script$4;
  1642. /* template */
  1643. var __vue_render__$4 = function() {
  1644. var _vm = this;
  1645. var _h = _vm.$createElement;
  1646. var _c = _vm._self._c || _h;
  1647. return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-3" }, [
  1648. _c(
  1649. "svg",
  1650. {
  1651. staticClass: "dv-border-svg-container",
  1652. attrs: { width: _vm.width, height: _vm.height }
  1653. },
  1654. [
  1655. _c("polygon", {
  1656. attrs: {
  1657. fill: _vm.backgroundColor,
  1658. points:
  1659. "\n 23, 23 " +
  1660. (_vm.width - 24) +
  1661. ", 23 " +
  1662. (_vm.width - 24) +
  1663. ", " +
  1664. (_vm.height - 24) +
  1665. " 23, " +
  1666. (_vm.height - 24) +
  1667. "\n "
  1668. }
  1669. }),
  1670. _vm._v(" "),
  1671. _c("polyline", {
  1672. staticClass: "dv-bb3-line1",
  1673. attrs: {
  1674. stroke: _vm.mergedColor[0],
  1675. points:
  1676. "4, 4 " +
  1677. (_vm.width - 22) +
  1678. " ,4 " +
  1679. (_vm.width - 22) +
  1680. ", " +
  1681. (_vm.height - 22) +
  1682. " 4, " +
  1683. (_vm.height - 22) +
  1684. " 4, 4"
  1685. }
  1686. }),
  1687. _vm._v(" "),
  1688. _c("polyline", {
  1689. staticClass: "dv-bb3-line2",
  1690. attrs: {
  1691. stroke: _vm.mergedColor[1],
  1692. points:
  1693. "10, 10 " +
  1694. (_vm.width - 16) +
  1695. ", 10 " +
  1696. (_vm.width - 16) +
  1697. ", " +
  1698. (_vm.height - 16) +
  1699. " 10, " +
  1700. (_vm.height - 16) +
  1701. " 10, 10"
  1702. }
  1703. }),
  1704. _vm._v(" "),
  1705. _c("polyline", {
  1706. staticClass: "dv-bb3-line2",
  1707. attrs: {
  1708. stroke: _vm.mergedColor[1],
  1709. points:
  1710. "16, 16 " +
  1711. (_vm.width - 10) +
  1712. ", 16 " +
  1713. (_vm.width - 10) +
  1714. ", " +
  1715. (_vm.height - 10) +
  1716. " 16, " +
  1717. (_vm.height - 10) +
  1718. " 16, 16"
  1719. }
  1720. }),
  1721. _vm._v(" "),
  1722. _c("polyline", {
  1723. staticClass: "dv-bb3-line2",
  1724. attrs: {
  1725. stroke: _vm.mergedColor[1],
  1726. points:
  1727. "22, 22 " +
  1728. (_vm.width - 4) +
  1729. ", 22 " +
  1730. (_vm.width - 4) +
  1731. ", " +
  1732. (_vm.height - 4) +
  1733. " 22, " +
  1734. (_vm.height - 4) +
  1735. " 22, 22"
  1736. }
  1737. })
  1738. ]
  1739. ),
  1740. _vm._v(" "),
  1741. _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
  1742. ])
  1743. };
  1744. var __vue_staticRenderFns__$4 = [];
  1745. __vue_render__$4._withStripped = true;
  1746. /* style */
  1747. const __vue_inject_styles__$4 = function (inject) {
  1748. if (!inject) return
  1749. inject("data-v-8dbfb74c_0", { source: ".dv-border-box-3 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-3 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-3 .dv-border-svg-container > polyline {\n fill: none;\n}\n.dv-border-box-3 .dv-bb3-line1 {\n stroke-width: 3;\n}\n.dv-border-box-3 .dv-bb3-line2 {\n stroke-width: 1;\n}\n.dv-border-box-3 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,UAAU;AACZ;AACA;EACE,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-3 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-3 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-3 .dv-border-svg-container > polyline {\n fill: none;\n}\n.dv-border-box-3 .dv-bb3-line1 {\n stroke-width: 3;\n}\n.dv-border-box-3 .dv-bb3-line2 {\n stroke-width: 1;\n}\n.dv-border-box-3 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  1750. };
  1751. /* scoped */
  1752. const __vue_scope_id__$4 = undefined;
  1753. /* module identifier */
  1754. const __vue_module_identifier__$4 = undefined;
  1755. /* functional template */
  1756. const __vue_is_functional_template__$4 = false;
  1757. /* style inject SSR */
  1758. /* style inject shadow dom */
  1759. const __vue_component__$4 = /*#__PURE__*/normalizeComponent(
  1760. { render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 },
  1761. __vue_inject_styles__$4,
  1762. __vue_script__$4,
  1763. __vue_scope_id__$4,
  1764. __vue_is_functional_template__$4,
  1765. __vue_module_identifier__$4,
  1766. false,
  1767. createInjector,
  1768. undefined,
  1769. undefined
  1770. );
  1771. function borderBox3 (Vue) {
  1772. Vue.component(__vue_component__$4.name, __vue_component__$4);
  1773. }
  1774. //
  1775. var script$5 = {
  1776. name: 'DvBorderBox4',
  1777. mixins: [autoResize],
  1778. props: {
  1779. color: {
  1780. type: Array,
  1781. default: () => []
  1782. },
  1783. reverse: {
  1784. type: Boolean,
  1785. default: false
  1786. },
  1787. backgroundColor: {
  1788. type: String,
  1789. default: 'transparent'
  1790. }
  1791. },
  1792. data() {
  1793. return {
  1794. ref: 'border-box-4',
  1795. defaultColor: ['red', 'rgba(0,0,255,0.8)'],
  1796. mergedColor: []
  1797. };
  1798. },
  1799. watch: {
  1800. color() {
  1801. const {
  1802. mergeColor
  1803. } = this;
  1804. mergeColor();
  1805. }
  1806. },
  1807. methods: {
  1808. mergeColor() {
  1809. const {
  1810. color,
  1811. defaultColor
  1812. } = this;
  1813. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  1814. }
  1815. },
  1816. mounted() {
  1817. const {
  1818. mergeColor
  1819. } = this;
  1820. mergeColor();
  1821. }
  1822. };
  1823. /* script */
  1824. const __vue_script__$5 = script$5;
  1825. /* template */
  1826. var __vue_render__$5 = function() {
  1827. var _vm = this;
  1828. var _h = _vm.$createElement;
  1829. var _c = _vm._self._c || _h;
  1830. return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-4" }, [
  1831. _c(
  1832. "svg",
  1833. {
  1834. class: "dv-border-svg-container " + (_vm.reverse && "dv-reverse"),
  1835. attrs: { width: _vm.width, height: _vm.height }
  1836. },
  1837. [
  1838. _c("polygon", {
  1839. attrs: {
  1840. fill: _vm.backgroundColor,
  1841. points:
  1842. "\n " +
  1843. (_vm.width - 15) +
  1844. ", 22 170, 22 150, 7 40, 7 28, 21 32, 24\n 16, 42 16, " +
  1845. (_vm.height - 32) +
  1846. " 41, " +
  1847. (_vm.height - 7) +
  1848. " " +
  1849. (_vm.width - 15) +
  1850. ", " +
  1851. (_vm.height - 7) +
  1852. "\n "
  1853. }
  1854. }),
  1855. _vm._v(" "),
  1856. _c("polyline", {
  1857. staticClass: "dv-bb4-line-1",
  1858. attrs: {
  1859. stroke: _vm.mergedColor[0],
  1860. points:
  1861. "145, " +
  1862. (_vm.height - 5) +
  1863. " 40, " +
  1864. (_vm.height - 5) +
  1865. " 10, " +
  1866. (_vm.height - 35) +
  1867. "\n 10, 40 40, 5 150, 5 170, 20 " +
  1868. (_vm.width - 15) +
  1869. ", 20"
  1870. }
  1871. }),
  1872. _vm._v(" "),
  1873. _c("polyline", {
  1874. staticClass: "dv-bb4-line-2",
  1875. attrs: {
  1876. stroke: _vm.mergedColor[1],
  1877. points:
  1878. "245, " +
  1879. (_vm.height - 1) +
  1880. " 36, " +
  1881. (_vm.height - 1) +
  1882. " 14, " +
  1883. (_vm.height - 23) +
  1884. "\n 14, " +
  1885. (_vm.height - 100)
  1886. }
  1887. }),
  1888. _vm._v(" "),
  1889. _c("polyline", {
  1890. staticClass: "dv-bb4-line-3",
  1891. attrs: {
  1892. stroke: _vm.mergedColor[0],
  1893. points: "7, " + (_vm.height - 40) + " 7, " + (_vm.height - 75)
  1894. }
  1895. }),
  1896. _vm._v(" "),
  1897. _c("polyline", {
  1898. staticClass: "dv-bb4-line-4",
  1899. attrs: { stroke: _vm.mergedColor[0], points: "28, 24 13, 41 13, 64" }
  1900. }),
  1901. _vm._v(" "),
  1902. _c("polyline", {
  1903. staticClass: "dv-bb4-line-5",
  1904. attrs: { stroke: _vm.mergedColor[0], points: "5, 45 5, 140" }
  1905. }),
  1906. _vm._v(" "),
  1907. _c("polyline", {
  1908. staticClass: "dv-bb4-line-6",
  1909. attrs: { stroke: _vm.mergedColor[1], points: "14, 75 14, 180" }
  1910. }),
  1911. _vm._v(" "),
  1912. _c("polyline", {
  1913. staticClass: "dv-bb4-line-7",
  1914. attrs: {
  1915. stroke: _vm.mergedColor[1],
  1916. points: "55, 11 147, 11 167, 26 250, 26"
  1917. }
  1918. }),
  1919. _vm._v(" "),
  1920. _c("polyline", {
  1921. staticClass: "dv-bb4-line-8",
  1922. attrs: { stroke: _vm.mergedColor[1], points: "158, 5 173, 16" }
  1923. }),
  1924. _vm._v(" "),
  1925. _c("polyline", {
  1926. staticClass: "dv-bb4-line-9",
  1927. attrs: {
  1928. stroke: _vm.mergedColor[0],
  1929. points: "200, 17 " + (_vm.width - 10) + ", 17"
  1930. }
  1931. }),
  1932. _vm._v(" "),
  1933. _c("polyline", {
  1934. staticClass: "dv-bb4-line-10",
  1935. attrs: {
  1936. stroke: _vm.mergedColor[1],
  1937. points: "385, 17 " + (_vm.width - 10) + ", 17"
  1938. }
  1939. })
  1940. ]
  1941. ),
  1942. _vm._v(" "),
  1943. _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
  1944. ])
  1945. };
  1946. var __vue_staticRenderFns__$5 = [];
  1947. __vue_render__$5._withStripped = true;
  1948. /* style */
  1949. const __vue_inject_styles__$5 = function (inject) {
  1950. if (!inject) return
  1951. inject("data-v-229480d1_0", { source: ".dv-border-box-4 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-4 .dv-reverse {\n transform: rotate(180deg);\n}\n.dv-border-box-4 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-4 .dv-border-svg-container > polyline {\n fill: none;\n}\n.dv-border-box-4 .sw1 {\n stroke-width: 1;\n}\n.dv-border-box-4 .sw3 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-1 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-2 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-3 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-4 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-5 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-6 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-7 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-8 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-9 {\n stroke-width: 3px;\n stroke-linecap: round;\n stroke-dasharray: 100 250;\n}\n.dv-border-box-4 .dv-bb4-line-10 {\n stroke-width: 1;\n stroke-dasharray: 80 270;\n}\n.dv-border-box-4 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,UAAU;AACZ;AACA;EACE,eAAe;AACjB;AACA;EACE,iBAAiB;EACjB,qBAAqB;AACvB;AACA;EACE,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,iBAAiB;EACjB,qBAAqB;AACvB;AACA;EACE,iBAAiB;EACjB,qBAAqB;AACvB;AACA;EACE,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,iBAAiB;EACjB,qBAAqB;AACvB;AACA;EACE,iBAAiB;EACjB,qBAAqB;EACrB,yBAAyB;AAC3B;AACA;EACE,eAAe;EACf,wBAAwB;AAC1B;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-4 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-4 .dv-reverse {\n transform: rotate(180deg);\n}\n.dv-border-box-4 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-4 .dv-border-svg-container > polyline {\n fill: none;\n}\n.dv-border-box-4 .sw1 {\n stroke-width: 1;\n}\n.dv-border-box-4 .sw3 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-1 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-2 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-3 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-4 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-5 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-6 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-7 {\n stroke-width: 1;\n}\n.dv-border-box-4 .dv-bb4-line-8 {\n stroke-width: 3px;\n stroke-linecap: round;\n}\n.dv-border-box-4 .dv-bb4-line-9 {\n stroke-width: 3px;\n stroke-linecap: round;\n stroke-dasharray: 100 250;\n}\n.dv-border-box-4 .dv-bb4-line-10 {\n stroke-width: 1;\n stroke-dasharray: 80 270;\n}\n.dv-border-box-4 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  1952. };
  1953. /* scoped */
  1954. const __vue_scope_id__$5 = undefined;
  1955. /* module identifier */
  1956. const __vue_module_identifier__$5 = undefined;
  1957. /* functional template */
  1958. const __vue_is_functional_template__$5 = false;
  1959. /* style inject SSR */
  1960. /* style inject shadow dom */
  1961. const __vue_component__$5 = /*#__PURE__*/normalizeComponent(
  1962. { render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 },
  1963. __vue_inject_styles__$5,
  1964. __vue_script__$5,
  1965. __vue_scope_id__$5,
  1966. __vue_is_functional_template__$5,
  1967. __vue_module_identifier__$5,
  1968. false,
  1969. createInjector,
  1970. undefined,
  1971. undefined
  1972. );
  1973. function borderBox4 (Vue) {
  1974. Vue.component(__vue_component__$5.name, __vue_component__$5);
  1975. }
  1976. //
  1977. var script$6 = {
  1978. name: 'DvBorderBox5',
  1979. mixins: [autoResize],
  1980. props: {
  1981. color: {
  1982. type: Array,
  1983. default: () => []
  1984. },
  1985. reverse: {
  1986. type: Boolean,
  1987. default: false
  1988. },
  1989. backgroundColor: {
  1990. type: String,
  1991. default: 'transparent'
  1992. }
  1993. },
  1994. data() {
  1995. return {
  1996. ref: 'border-box-5',
  1997. defaultColor: ['rgba(255, 255, 255, 0.35)', 'rgba(255, 255, 255, 0.20)'],
  1998. mergedColor: []
  1999. };
  2000. },
  2001. watch: {
  2002. color() {
  2003. const {
  2004. mergeColor
  2005. } = this;
  2006. mergeColor();
  2007. }
  2008. },
  2009. methods: {
  2010. mergeColor() {
  2011. const {
  2012. color,
  2013. defaultColor
  2014. } = this;
  2015. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  2016. }
  2017. },
  2018. mounted() {
  2019. const {
  2020. mergeColor
  2021. } = this;
  2022. mergeColor();
  2023. }
  2024. };
  2025. /* script */
  2026. const __vue_script__$6 = script$6;
  2027. /* template */
  2028. var __vue_render__$6 = function() {
  2029. var _vm = this;
  2030. var _h = _vm.$createElement;
  2031. var _c = _vm._self._c || _h;
  2032. return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-5" }, [
  2033. _c(
  2034. "svg",
  2035. {
  2036. class: "dv-border-svg-container " + (_vm.reverse && "dv-reverse"),
  2037. attrs: { width: _vm.width, height: _vm.height }
  2038. },
  2039. [
  2040. _c("polygon", {
  2041. attrs: {
  2042. fill: _vm.backgroundColor,
  2043. points:
  2044. "\n 10, 22 " +
  2045. (_vm.width - 22) +
  2046. ", 22 " +
  2047. (_vm.width - 22) +
  2048. ", " +
  2049. (_vm.height - 86) +
  2050. " " +
  2051. (_vm.width - 84) +
  2052. ", " +
  2053. (_vm.height - 24) +
  2054. " 10, " +
  2055. (_vm.height - 24) +
  2056. "\n "
  2057. }
  2058. }),
  2059. _vm._v(" "),
  2060. _c("polyline", {
  2061. staticClass: "dv-bb5-line-1",
  2062. attrs: {
  2063. stroke: _vm.mergedColor[0],
  2064. points:
  2065. "8, 5 " +
  2066. (_vm.width - 5) +
  2067. ", 5 " +
  2068. (_vm.width - 5) +
  2069. ", " +
  2070. (_vm.height - 100) +
  2071. "\n " +
  2072. (_vm.width - 100) +
  2073. ", " +
  2074. (_vm.height - 5) +
  2075. " 8, " +
  2076. (_vm.height - 5) +
  2077. " 8, 5"
  2078. }
  2079. }),
  2080. _vm._v(" "),
  2081. _c("polyline", {
  2082. staticClass: "dv-bb5-line-2",
  2083. attrs: {
  2084. stroke: _vm.mergedColor[1],
  2085. points:
  2086. "3, 5 " +
  2087. (_vm.width - 20) +
  2088. ", 5 " +
  2089. (_vm.width - 20) +
  2090. ", " +
  2091. (_vm.height - 60) +
  2092. "\n " +
  2093. (_vm.width - 74) +
  2094. ", " +
  2095. (_vm.height - 5) +
  2096. " 3, " +
  2097. (_vm.height - 5) +
  2098. " 3, 5"
  2099. }
  2100. }),
  2101. _vm._v(" "),
  2102. _c("polyline", {
  2103. staticClass: "dv-bb5-line-3",
  2104. attrs: {
  2105. stroke: _vm.mergedColor[1],
  2106. points: "50, 13 " + (_vm.width - 35) + ", 13"
  2107. }
  2108. }),
  2109. _vm._v(" "),
  2110. _c("polyline", {
  2111. staticClass: "dv-bb5-line-4",
  2112. attrs: {
  2113. stroke: _vm.mergedColor[1],
  2114. points: "15, 20 " + (_vm.width - 35) + ", 20"
  2115. }
  2116. }),
  2117. _vm._v(" "),
  2118. _c("polyline", {
  2119. staticClass: "dv-bb5-line-5",
  2120. attrs: {
  2121. stroke: _vm.mergedColor[1],
  2122. points:
  2123. "15, " +
  2124. (_vm.height - 20) +
  2125. " " +
  2126. (_vm.width - 110) +
  2127. ", " +
  2128. (_vm.height - 20)
  2129. }
  2130. }),
  2131. _vm._v(" "),
  2132. _c("polyline", {
  2133. staticClass: "dv-bb5-line-6",
  2134. attrs: {
  2135. stroke: _vm.mergedColor[1],
  2136. points:
  2137. "15, " +
  2138. (_vm.height - 13) +
  2139. " " +
  2140. (_vm.width - 110) +
  2141. ", " +
  2142. (_vm.height - 13)
  2143. }
  2144. })
  2145. ]
  2146. ),
  2147. _vm._v(" "),
  2148. _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
  2149. ])
  2150. };
  2151. var __vue_staticRenderFns__$6 = [];
  2152. __vue_render__$6._withStripped = true;
  2153. /* style */
  2154. const __vue_inject_styles__$6 = function (inject) {
  2155. if (!inject) return
  2156. inject("data-v-5e711d00_0", { source: ".dv-border-box-5 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-5 .dv-reverse {\n transform: rotate(180deg);\n}\n.dv-border-box-5 .dv-border-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-5 .dv-border-svg-container > polyline {\n fill: none;\n}\n.dv-border-box-5 .dv-bb5-line-1,\n.dv-border-box-5 .dv-bb5-line-2 {\n stroke-width: 1;\n}\n.dv-border-box-5 .dv-bb5-line-3,\n.dv-border-box-5 .dv-bb5-line-6 {\n stroke-width: 5;\n}\n.dv-border-box-5 .dv-bb5-line-4,\n.dv-border-box-5 .dv-bb5-line-5 {\n stroke-width: 2;\n}\n.dv-border-box-5 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,WAAW;EACX,YAAY;AACd;AACA;EACE,UAAU;AACZ;AACA;;EAEE,eAAe;AACjB;AACA;;EAEE,eAAe;AACjB;AACA;;EAEE,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-5 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-5 .dv-reverse {\n transform: rotate(180deg);\n}\n.dv-border-box-5 .dv-border-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-5 .dv-border-svg-container > polyline {\n fill: none;\n}\n.dv-border-box-5 .dv-bb5-line-1,\n.dv-border-box-5 .dv-bb5-line-2 {\n stroke-width: 1;\n}\n.dv-border-box-5 .dv-bb5-line-3,\n.dv-border-box-5 .dv-bb5-line-6 {\n stroke-width: 5;\n}\n.dv-border-box-5 .dv-bb5-line-4,\n.dv-border-box-5 .dv-bb5-line-5 {\n stroke-width: 2;\n}\n.dv-border-box-5 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  2157. };
  2158. /* scoped */
  2159. const __vue_scope_id__$6 = undefined;
  2160. /* module identifier */
  2161. const __vue_module_identifier__$6 = undefined;
  2162. /* functional template */
  2163. const __vue_is_functional_template__$6 = false;
  2164. /* style inject SSR */
  2165. /* style inject shadow dom */
  2166. const __vue_component__$6 = /*#__PURE__*/normalizeComponent(
  2167. { render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 },
  2168. __vue_inject_styles__$6,
  2169. __vue_script__$6,
  2170. __vue_scope_id__$6,
  2171. __vue_is_functional_template__$6,
  2172. __vue_module_identifier__$6,
  2173. false,
  2174. createInjector,
  2175. undefined,
  2176. undefined
  2177. );
  2178. function borderBox5 (Vue) {
  2179. Vue.component(__vue_component__$6.name, __vue_component__$6);
  2180. }
  2181. //
  2182. var script$7 = {
  2183. name: 'DvBorderBox6',
  2184. mixins: [autoResize],
  2185. props: {
  2186. color: {
  2187. type: Array,
  2188. default: () => []
  2189. },
  2190. backgroundColor: {
  2191. type: String,
  2192. default: 'transparent'
  2193. }
  2194. },
  2195. data() {
  2196. return {
  2197. ref: 'border-box-6',
  2198. defaultColor: ['rgba(255, 255, 255, 0.35)', 'gray'],
  2199. mergedColor: []
  2200. };
  2201. },
  2202. watch: {
  2203. color() {
  2204. const {
  2205. mergeColor
  2206. } = this;
  2207. mergeColor();
  2208. }
  2209. },
  2210. methods: {
  2211. mergeColor() {
  2212. const {
  2213. color,
  2214. defaultColor
  2215. } = this;
  2216. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  2217. }
  2218. },
  2219. mounted() {
  2220. const {
  2221. mergeColor
  2222. } = this;
  2223. mergeColor();
  2224. }
  2225. };
  2226. /* script */
  2227. const __vue_script__$7 = script$7;
  2228. /* template */
  2229. var __vue_render__$7 = function() {
  2230. var _vm = this;
  2231. var _h = _vm.$createElement;
  2232. var _c = _vm._self._c || _h;
  2233. return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-6" }, [
  2234. _c(
  2235. "svg",
  2236. {
  2237. staticClass: "dv-border-svg-container",
  2238. attrs: { width: _vm.width, height: _vm.height }
  2239. },
  2240. [
  2241. _c("polygon", {
  2242. attrs: {
  2243. fill: _vm.backgroundColor,
  2244. points:
  2245. "\n 9, 7 " +
  2246. (_vm.width - 9) +
  2247. ", 7 " +
  2248. (_vm.width - 9) +
  2249. ", " +
  2250. (_vm.height - 7) +
  2251. " 9, " +
  2252. (_vm.height - 7) +
  2253. "\n "
  2254. }
  2255. }),
  2256. _vm._v(" "),
  2257. _c("circle", {
  2258. attrs: { fill: _vm.mergedColor[1], cx: "5", cy: "5", r: "2" }
  2259. }),
  2260. _vm._v(" "),
  2261. _c("circle", {
  2262. attrs: {
  2263. fill: _vm.mergedColor[1],
  2264. cx: _vm.width - 5,
  2265. cy: "5",
  2266. r: "2"
  2267. }
  2268. }),
  2269. _vm._v(" "),
  2270. _c("circle", {
  2271. attrs: {
  2272. fill: _vm.mergedColor[1],
  2273. cx: _vm.width - 5,
  2274. cy: _vm.height - 5,
  2275. r: "2"
  2276. }
  2277. }),
  2278. _vm._v(" "),
  2279. _c("circle", {
  2280. attrs: {
  2281. fill: _vm.mergedColor[1],
  2282. cx: "5",
  2283. cy: _vm.height - 5,
  2284. r: "2"
  2285. }
  2286. }),
  2287. _vm._v(" "),
  2288. _c("polyline", {
  2289. attrs: {
  2290. stroke: _vm.mergedColor[0],
  2291. points: "10, 4 " + (_vm.width - 10) + ", 4"
  2292. }
  2293. }),
  2294. _vm._v(" "),
  2295. _c("polyline", {
  2296. attrs: {
  2297. stroke: _vm.mergedColor[0],
  2298. points:
  2299. "10, " +
  2300. (_vm.height - 4) +
  2301. " " +
  2302. (_vm.width - 10) +
  2303. ", " +
  2304. (_vm.height - 4)
  2305. }
  2306. }),
  2307. _vm._v(" "),
  2308. _c("polyline", {
  2309. attrs: {
  2310. stroke: _vm.mergedColor[0],
  2311. points: "5, 70 5, " + (_vm.height - 70)
  2312. }
  2313. }),
  2314. _vm._v(" "),
  2315. _c("polyline", {
  2316. attrs: {
  2317. stroke: _vm.mergedColor[0],
  2318. points:
  2319. _vm.width -
  2320. 5 +
  2321. ", 70 " +
  2322. (_vm.width - 5) +
  2323. ", " +
  2324. (_vm.height - 70)
  2325. }
  2326. }),
  2327. _vm._v(" "),
  2328. _c("polyline", {
  2329. attrs: { stroke: _vm.mergedColor[0], points: "3, 10, 3, 50" }
  2330. }),
  2331. _vm._v(" "),
  2332. _c("polyline", {
  2333. attrs: { stroke: _vm.mergedColor[0], points: "7, 30 7, 80" }
  2334. }),
  2335. _vm._v(" "),
  2336. _c("polyline", {
  2337. attrs: {
  2338. stroke: _vm.mergedColor[0],
  2339. points: _vm.width - 3 + ", 10 " + (_vm.width - 3) + ", 50"
  2340. }
  2341. }),
  2342. _vm._v(" "),
  2343. _c("polyline", {
  2344. attrs: {
  2345. stroke: _vm.mergedColor[0],
  2346. points: _vm.width - 7 + ", 30 " + (_vm.width - 7) + ", 80"
  2347. }
  2348. }),
  2349. _vm._v(" "),
  2350. _c("polyline", {
  2351. attrs: {
  2352. stroke: _vm.mergedColor[0],
  2353. points: "3, " + (_vm.height - 10) + " 3, " + (_vm.height - 50)
  2354. }
  2355. }),
  2356. _vm._v(" "),
  2357. _c("polyline", {
  2358. attrs: {
  2359. stroke: _vm.mergedColor[0],
  2360. points: "7, " + (_vm.height - 30) + " 7, " + (_vm.height - 80)
  2361. }
  2362. }),
  2363. _vm._v(" "),
  2364. _c("polyline", {
  2365. attrs: {
  2366. stroke: _vm.mergedColor[0],
  2367. points:
  2368. _vm.width -
  2369. 3 +
  2370. ", " +
  2371. (_vm.height - 10) +
  2372. " " +
  2373. (_vm.width - 3) +
  2374. ", " +
  2375. (_vm.height - 50)
  2376. }
  2377. }),
  2378. _vm._v(" "),
  2379. _c("polyline", {
  2380. attrs: {
  2381. stroke: _vm.mergedColor[0],
  2382. points:
  2383. _vm.width -
  2384. 7 +
  2385. ", " +
  2386. (_vm.height - 30) +
  2387. " " +
  2388. (_vm.width - 7) +
  2389. ", " +
  2390. (_vm.height - 80)
  2391. }
  2392. })
  2393. ]
  2394. ),
  2395. _vm._v(" "),
  2396. _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
  2397. ])
  2398. };
  2399. var __vue_staticRenderFns__$7 = [];
  2400. __vue_render__$7._withStripped = true;
  2401. /* style */
  2402. const __vue_inject_styles__$7 = function (inject) {
  2403. if (!inject) return
  2404. inject("data-v-715598fc_0", { source: ".dv-border-box-6 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-6 .dv-border-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-6 .dv-border-svg-container > polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-6 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,WAAW;EACX,YAAY;AACd;AACA;EACE,UAAU;EACV,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-6 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-6 .dv-border-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-6 .dv-border-svg-container > polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-6 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  2405. };
  2406. /* scoped */
  2407. const __vue_scope_id__$7 = undefined;
  2408. /* module identifier */
  2409. const __vue_module_identifier__$7 = undefined;
  2410. /* functional template */
  2411. const __vue_is_functional_template__$7 = false;
  2412. /* style inject SSR */
  2413. /* style inject shadow dom */
  2414. const __vue_component__$7 = /*#__PURE__*/normalizeComponent(
  2415. { render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 },
  2416. __vue_inject_styles__$7,
  2417. __vue_script__$7,
  2418. __vue_scope_id__$7,
  2419. __vue_is_functional_template__$7,
  2420. __vue_module_identifier__$7,
  2421. false,
  2422. createInjector,
  2423. undefined,
  2424. undefined
  2425. );
  2426. function borderBox6 (Vue) {
  2427. Vue.component(__vue_component__$7.name, __vue_component__$7);
  2428. }
  2429. //
  2430. var script$8 = {
  2431. name: 'DvBorderBox7',
  2432. mixins: [autoResize],
  2433. props: {
  2434. color: {
  2435. type: Array,
  2436. default: () => []
  2437. },
  2438. backgroundColor: {
  2439. type: String,
  2440. default: 'transparent'
  2441. }
  2442. },
  2443. data() {
  2444. return {
  2445. ref: 'border-box-7',
  2446. defaultColor: ['rgba(128,128,128,0.3)', 'rgba(128,128,128,0.5)'],
  2447. mergedColor: []
  2448. };
  2449. },
  2450. watch: {
  2451. color() {
  2452. const {
  2453. mergeColor
  2454. } = this;
  2455. mergeColor();
  2456. }
  2457. },
  2458. methods: {
  2459. mergeColor() {
  2460. const {
  2461. color,
  2462. defaultColor
  2463. } = this;
  2464. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  2465. }
  2466. },
  2467. mounted() {
  2468. const {
  2469. mergeColor
  2470. } = this;
  2471. mergeColor();
  2472. }
  2473. };
  2474. /* script */
  2475. const __vue_script__$8 = script$8;
  2476. /* template */
  2477. var __vue_render__$8 = function() {
  2478. var _vm = this;
  2479. var _h = _vm.$createElement;
  2480. var _c = _vm._self._c || _h;
  2481. return _c(
  2482. "div",
  2483. {
  2484. ref: _vm.ref,
  2485. staticClass: "dv-border-box-7",
  2486. style:
  2487. "box-shadow: inset 0 0 40px " +
  2488. _vm.mergedColor[0] +
  2489. "; border: 1px solid " +
  2490. _vm.mergedColor[0] +
  2491. "; background-color: " +
  2492. _vm.backgroundColor
  2493. },
  2494. [
  2495. _c(
  2496. "svg",
  2497. {
  2498. staticClass: "dv-border-svg-container",
  2499. attrs: { width: _vm.width, height: _vm.height }
  2500. },
  2501. [
  2502. _c("polyline", {
  2503. staticClass: "dv-bb7-line-width-2",
  2504. attrs: { stroke: _vm.mergedColor[0], points: "0, 25 0, 0 25, 0" }
  2505. }),
  2506. _vm._v(" "),
  2507. _c("polyline", {
  2508. staticClass: "dv-bb7-line-width-2",
  2509. attrs: {
  2510. stroke: _vm.mergedColor[0],
  2511. points:
  2512. _vm.width -
  2513. 25 +
  2514. ", 0 " +
  2515. _vm.width +
  2516. ", 0 " +
  2517. _vm.width +
  2518. ", 25"
  2519. }
  2520. }),
  2521. _vm._v(" "),
  2522. _c("polyline", {
  2523. staticClass: "dv-bb7-line-width-2",
  2524. attrs: {
  2525. stroke: _vm.mergedColor[0],
  2526. points:
  2527. _vm.width -
  2528. 25 +
  2529. ", " +
  2530. _vm.height +
  2531. " " +
  2532. _vm.width +
  2533. ", " +
  2534. _vm.height +
  2535. " " +
  2536. _vm.width +
  2537. ", " +
  2538. (_vm.height - 25)
  2539. }
  2540. }),
  2541. _vm._v(" "),
  2542. _c("polyline", {
  2543. staticClass: "dv-bb7-line-width-2",
  2544. attrs: {
  2545. stroke: _vm.mergedColor[0],
  2546. points:
  2547. "0, " +
  2548. (_vm.height - 25) +
  2549. " 0, " +
  2550. _vm.height +
  2551. " 25, " +
  2552. _vm.height
  2553. }
  2554. }),
  2555. _vm._v(" "),
  2556. _c("polyline", {
  2557. staticClass: "dv-bb7-line-width-5",
  2558. attrs: { stroke: _vm.mergedColor[1], points: "0, 10 0, 0 10, 0" }
  2559. }),
  2560. _vm._v(" "),
  2561. _c("polyline", {
  2562. staticClass: "dv-bb7-line-width-5",
  2563. attrs: {
  2564. stroke: _vm.mergedColor[1],
  2565. points:
  2566. _vm.width -
  2567. 10 +
  2568. ", 0 " +
  2569. _vm.width +
  2570. ", 0 " +
  2571. _vm.width +
  2572. ", 10"
  2573. }
  2574. }),
  2575. _vm._v(" "),
  2576. _c("polyline", {
  2577. staticClass: "dv-bb7-line-width-5",
  2578. attrs: {
  2579. stroke: _vm.mergedColor[1],
  2580. points:
  2581. _vm.width -
  2582. 10 +
  2583. ", " +
  2584. _vm.height +
  2585. " " +
  2586. _vm.width +
  2587. ", " +
  2588. _vm.height +
  2589. " " +
  2590. _vm.width +
  2591. ", " +
  2592. (_vm.height - 10)
  2593. }
  2594. }),
  2595. _vm._v(" "),
  2596. _c("polyline", {
  2597. staticClass: "dv-bb7-line-width-5",
  2598. attrs: {
  2599. stroke: _vm.mergedColor[1],
  2600. points:
  2601. "0, " +
  2602. (_vm.height - 10) +
  2603. " 0, " +
  2604. _vm.height +
  2605. " 10, " +
  2606. _vm.height
  2607. }
  2608. })
  2609. ]
  2610. ),
  2611. _vm._v(" "),
  2612. _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
  2613. ]
  2614. )
  2615. };
  2616. var __vue_staticRenderFns__$8 = [];
  2617. __vue_render__$8._withStripped = true;
  2618. /* style */
  2619. const __vue_inject_styles__$8 = function (inject) {
  2620. if (!inject) return
  2621. inject("data-v-21156cd2_0", { source: ".dv-border-box-7 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-7 .dv-border-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-7 .dv-border-svg-container > polyline {\n fill: none;\n stroke-linecap: round;\n}\n.dv-border-box-7 .dv-bb7-line-width-2 {\n stroke-width: 2;\n}\n.dv-border-box-7 .dv-bb7-line-width-5 {\n stroke-width: 5;\n}\n.dv-border-box-7 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,WAAW;EACX,YAAY;AACd;AACA;EACE,UAAU;EACV,qBAAqB;AACvB;AACA;EACE,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-7 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-7 .dv-border-svg-container {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-7 .dv-border-svg-container > polyline {\n fill: none;\n stroke-linecap: round;\n}\n.dv-border-box-7 .dv-bb7-line-width-2 {\n stroke-width: 2;\n}\n.dv-border-box-7 .dv-bb7-line-width-5 {\n stroke-width: 5;\n}\n.dv-border-box-7 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  2622. };
  2623. /* scoped */
  2624. const __vue_scope_id__$8 = undefined;
  2625. /* module identifier */
  2626. const __vue_module_identifier__$8 = undefined;
  2627. /* functional template */
  2628. const __vue_is_functional_template__$8 = false;
  2629. /* style inject SSR */
  2630. /* style inject shadow dom */
  2631. const __vue_component__$8 = /*#__PURE__*/normalizeComponent(
  2632. { render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 },
  2633. __vue_inject_styles__$8,
  2634. __vue_script__$8,
  2635. __vue_scope_id__$8,
  2636. __vue_is_functional_template__$8,
  2637. __vue_module_identifier__$8,
  2638. false,
  2639. createInjector,
  2640. undefined,
  2641. undefined
  2642. );
  2643. function borderBox7 (Vue) {
  2644. Vue.component(__vue_component__$8.name, __vue_component__$8);
  2645. }
  2646. //
  2647. var script$9 = {
  2648. name: 'DvBorderBox8',
  2649. mixins: [autoResize],
  2650. props: {
  2651. color: {
  2652. type: Array,
  2653. default: () => []
  2654. },
  2655. dur: {
  2656. type: Number,
  2657. default: 3
  2658. },
  2659. backgroundColor: {
  2660. type: String,
  2661. default: 'transparent'
  2662. },
  2663. reverse: {
  2664. type: Boolean,
  2665. default: false
  2666. }
  2667. },
  2668. data() {
  2669. const id = uuid();
  2670. return {
  2671. ref: 'border-box-8',
  2672. path: `border-box-8-path-${id}`,
  2673. gradient: `border-box-8-gradient-${id}`,
  2674. mask: `border-box-8-mask-${id}`,
  2675. defaultColor: ['#235fa7', '#4fd2dd'],
  2676. mergedColor: []
  2677. };
  2678. },
  2679. computed: {
  2680. length() {
  2681. const {
  2682. width,
  2683. height
  2684. } = this;
  2685. return (width + height - 5) * 2;
  2686. },
  2687. pathD() {
  2688. const {
  2689. reverse,
  2690. width,
  2691. height
  2692. } = this;
  2693. if (reverse) return `M 2.5, 2.5 L 2.5, ${height - 2.5} L ${width - 2.5}, ${height - 2.5} L ${width - 2.5}, 2.5 L 2.5, 2.5`;
  2694. return `M2.5, 2.5 L${width - 2.5}, 2.5 L${width - 2.5}, ${height - 2.5} L2.5, ${height - 2.5} L2.5, 2.5`;
  2695. }
  2696. },
  2697. watch: {
  2698. color() {
  2699. const {
  2700. mergeColor
  2701. } = this;
  2702. mergeColor();
  2703. }
  2704. },
  2705. methods: {
  2706. mergeColor() {
  2707. const {
  2708. color,
  2709. defaultColor
  2710. } = this;
  2711. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  2712. }
  2713. },
  2714. mounted() {
  2715. const {
  2716. mergeColor
  2717. } = this;
  2718. mergeColor();
  2719. }
  2720. };
  2721. /* script */
  2722. const __vue_script__$9 = script$9;
  2723. /* template */
  2724. var __vue_render__$9 = function() {
  2725. var _vm = this;
  2726. var _h = _vm.$createElement;
  2727. var _c = _vm._self._c || _h;
  2728. return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-8" }, [
  2729. _c(
  2730. "svg",
  2731. {
  2732. staticClass: "dv-border-svg-container",
  2733. attrs: { width: _vm.width, height: _vm.height }
  2734. },
  2735. [
  2736. _c(
  2737. "defs",
  2738. [
  2739. _c("path", {
  2740. attrs: { id: _vm.path, d: _vm.pathD, fill: "transparent" }
  2741. }),
  2742. _vm._v(" "),
  2743. _c(
  2744. "radialGradient",
  2745. { attrs: { id: _vm.gradient, cx: "50%", cy: "50%", r: "50%" } },
  2746. [
  2747. _c("stop", {
  2748. attrs: {
  2749. offset: "0%",
  2750. "stop-color": "#fff",
  2751. "stop-opacity": "1"
  2752. }
  2753. }),
  2754. _vm._v(" "),
  2755. _c("stop", {
  2756. attrs: {
  2757. offset: "100%",
  2758. "stop-color": "#fff",
  2759. "stop-opacity": "0"
  2760. }
  2761. })
  2762. ],
  2763. 1
  2764. ),
  2765. _vm._v(" "),
  2766. _c("mask", { attrs: { id: _vm.mask } }, [
  2767. _c(
  2768. "circle",
  2769. {
  2770. attrs: {
  2771. cx: "0",
  2772. cy: "0",
  2773. r: "150",
  2774. fill: "url(#" + _vm.gradient + ")"
  2775. }
  2776. },
  2777. [
  2778. _c("animateMotion", {
  2779. attrs: {
  2780. dur: _vm.dur + "s",
  2781. path: _vm.pathD,
  2782. rotate: "auto",
  2783. repeatCount: "indefinite"
  2784. }
  2785. })
  2786. ],
  2787. 1
  2788. )
  2789. ])
  2790. ],
  2791. 1
  2792. ),
  2793. _vm._v(" "),
  2794. _c("polygon", {
  2795. attrs: {
  2796. fill: _vm.backgroundColor,
  2797. points:
  2798. "5, 5 " +
  2799. (_vm.width - 5) +
  2800. ", 5 " +
  2801. (_vm.width - 5) +
  2802. " " +
  2803. (_vm.height - 5) +
  2804. " 5, " +
  2805. (_vm.height - 5)
  2806. }
  2807. }),
  2808. _vm._v(" "),
  2809. _c("use", {
  2810. attrs: {
  2811. stroke: _vm.mergedColor[0],
  2812. "stroke-width": "1",
  2813. "xlink:href": "#" + _vm.path
  2814. }
  2815. }),
  2816. _vm._v(" "),
  2817. _c(
  2818. "use",
  2819. {
  2820. attrs: {
  2821. stroke: _vm.mergedColor[1],
  2822. "stroke-width": "3",
  2823. "xlink:href": "#" + _vm.path,
  2824. mask: "url(#" + _vm.mask + ")"
  2825. }
  2826. },
  2827. [
  2828. _c("animate", {
  2829. attrs: {
  2830. attributeName: "stroke-dasharray",
  2831. from: "0, " + _vm.length,
  2832. to: _vm.length + ", 0",
  2833. dur: _vm.dur + "s",
  2834. repeatCount: "indefinite"
  2835. }
  2836. })
  2837. ]
  2838. )
  2839. ]
  2840. ),
  2841. _vm._v(" "),
  2842. _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
  2843. ])
  2844. };
  2845. var __vue_staticRenderFns__$9 = [];
  2846. __vue_render__$9._withStripped = true;
  2847. /* style */
  2848. const __vue_inject_styles__$9 = function (inject) {
  2849. if (!inject) return
  2850. inject("data-v-681e49b5_0", { source: ".dv-border-box-8 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-8 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n}\n.dv-border-box-8 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,SAAS;EACT,QAAQ;AACV;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-8 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-8 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n}\n.dv-border-box-8 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  2851. };
  2852. /* scoped */
  2853. const __vue_scope_id__$9 = undefined;
  2854. /* module identifier */
  2855. const __vue_module_identifier__$9 = undefined;
  2856. /* functional template */
  2857. const __vue_is_functional_template__$9 = false;
  2858. /* style inject SSR */
  2859. /* style inject shadow dom */
  2860. const __vue_component__$9 = /*#__PURE__*/normalizeComponent(
  2861. { render: __vue_render__$9, staticRenderFns: __vue_staticRenderFns__$9 },
  2862. __vue_inject_styles__$9,
  2863. __vue_script__$9,
  2864. __vue_scope_id__$9,
  2865. __vue_is_functional_template__$9,
  2866. __vue_module_identifier__$9,
  2867. false,
  2868. createInjector,
  2869. undefined,
  2870. undefined
  2871. );
  2872. function borderBox8 (Vue) {
  2873. Vue.component(__vue_component__$9.name, __vue_component__$9);
  2874. }
  2875. //
  2876. var script$a = {
  2877. name: 'DvBorderBox9',
  2878. mixins: [autoResize],
  2879. props: {
  2880. color: {
  2881. type: Array,
  2882. default: () => []
  2883. },
  2884. backgroundColor: {
  2885. type: String,
  2886. default: 'transparent'
  2887. }
  2888. },
  2889. data() {
  2890. const id = uuid();
  2891. return {
  2892. ref: 'border-box-9',
  2893. gradientId: `border-box-9-gradient-${id}`,
  2894. maskId: `border-box-9-mask-${id}`,
  2895. defaultColor: ['#11eefd', '#0078d2'],
  2896. mergedColor: []
  2897. };
  2898. },
  2899. watch: {
  2900. color() {
  2901. const {
  2902. mergeColor
  2903. } = this;
  2904. mergeColor();
  2905. }
  2906. },
  2907. methods: {
  2908. mergeColor() {
  2909. const {
  2910. color,
  2911. defaultColor
  2912. } = this;
  2913. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  2914. }
  2915. },
  2916. mounted() {
  2917. const {
  2918. mergeColor
  2919. } = this;
  2920. mergeColor();
  2921. }
  2922. };
  2923. /* script */
  2924. const __vue_script__$a = script$a;
  2925. /* template */
  2926. var __vue_render__$a = function() {
  2927. var _vm = this;
  2928. var _h = _vm.$createElement;
  2929. var _c = _vm._self._c || _h;
  2930. return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-9" }, [
  2931. _c(
  2932. "svg",
  2933. {
  2934. staticClass: "dv-border-svg-container",
  2935. attrs: { width: _vm.width, height: _vm.height }
  2936. },
  2937. [
  2938. _c(
  2939. "defs",
  2940. [
  2941. _c(
  2942. "linearGradient",
  2943. {
  2944. attrs: {
  2945. id: _vm.gradientId,
  2946. x1: "0%",
  2947. y1: "0%",
  2948. x2: "100%",
  2949. y2: "100%"
  2950. }
  2951. },
  2952. [
  2953. _c("animate", {
  2954. attrs: {
  2955. attributeName: "x1",
  2956. values: "0%;100%;0%",
  2957. dur: "10s",
  2958. begin: "0s",
  2959. repeatCount: "indefinite"
  2960. }
  2961. }),
  2962. _vm._v(" "),
  2963. _c("animate", {
  2964. attrs: {
  2965. attributeName: "x2",
  2966. values: "100%;0%;100%",
  2967. dur: "10s",
  2968. begin: "0s",
  2969. repeatCount: "indefinite"
  2970. }
  2971. }),
  2972. _vm._v(" "),
  2973. _c(
  2974. "stop",
  2975. { attrs: { offset: "0%", "stop-color": _vm.mergedColor[0] } },
  2976. [
  2977. _c("animate", {
  2978. attrs: {
  2979. attributeName: "stop-color",
  2980. values:
  2981. _vm.mergedColor[0] +
  2982. ";" +
  2983. _vm.mergedColor[1] +
  2984. ";" +
  2985. _vm.mergedColor[0],
  2986. dur: "10s",
  2987. begin: "0s",
  2988. repeatCount: "indefinite"
  2989. }
  2990. })
  2991. ]
  2992. ),
  2993. _vm._v(" "),
  2994. _c(
  2995. "stop",
  2996. {
  2997. attrs: { offset: "100%", "stop-color": _vm.mergedColor[1] }
  2998. },
  2999. [
  3000. _c("animate", {
  3001. attrs: {
  3002. attributeName: "stop-color",
  3003. values:
  3004. _vm.mergedColor[1] +
  3005. ";" +
  3006. _vm.mergedColor[0] +
  3007. ";" +
  3008. _vm.mergedColor[1],
  3009. dur: "10s",
  3010. begin: "0s",
  3011. repeatCount: "indefinite"
  3012. }
  3013. })
  3014. ]
  3015. )
  3016. ],
  3017. 1
  3018. ),
  3019. _vm._v(" "),
  3020. _c("mask", { attrs: { id: _vm.maskId } }, [
  3021. _c("polyline", {
  3022. attrs: {
  3023. stroke: "#fff",
  3024. "stroke-width": "3",
  3025. fill: "transparent",
  3026. points:
  3027. "8, " +
  3028. _vm.height * 0.4 +
  3029. " 8, 3, " +
  3030. (_vm.width * 0.4 + 7) +
  3031. ", 3"
  3032. }
  3033. }),
  3034. _vm._v(" "),
  3035. _c("polyline", {
  3036. attrs: {
  3037. fill: "#fff",
  3038. points:
  3039. "8, " +
  3040. _vm.height * 0.15 +
  3041. " 8, 3, " +
  3042. (_vm.width * 0.1 + 7) +
  3043. ", 3\n " +
  3044. _vm.width * 0.1 +
  3045. ", 8 14, 8 14, " +
  3046. (_vm.height * 0.15 - 7) +
  3047. "\n "
  3048. }
  3049. }),
  3050. _vm._v(" "),
  3051. _c("polyline", {
  3052. attrs: {
  3053. stroke: "#fff",
  3054. "stroke-width": "3",
  3055. fill: "transparent",
  3056. points:
  3057. _vm.width * 0.5 +
  3058. ", 3 " +
  3059. (_vm.width - 3) +
  3060. ", 3, " +
  3061. (_vm.width - 3) +
  3062. ", " +
  3063. _vm.height * 0.25
  3064. }
  3065. }),
  3066. _vm._v(" "),
  3067. _c("polyline", {
  3068. attrs: {
  3069. fill: "#fff",
  3070. points:
  3071. "\n " +
  3072. _vm.width * 0.52 +
  3073. ", 3 " +
  3074. _vm.width * 0.58 +
  3075. ", 3\n " +
  3076. (_vm.width * 0.58 - 7) +
  3077. ", 9 " +
  3078. (_vm.width * 0.52 + 7) +
  3079. ", 9\n "
  3080. }
  3081. }),
  3082. _vm._v(" "),
  3083. _c("polyline", {
  3084. attrs: {
  3085. fill: "#fff",
  3086. points:
  3087. "\n " +
  3088. _vm.width * 0.9 +
  3089. ", 3 " +
  3090. (_vm.width - 3) +
  3091. ", 3 " +
  3092. (_vm.width - 3) +
  3093. ", " +
  3094. _vm.height * 0.1 +
  3095. "\n " +
  3096. (_vm.width - 9) +
  3097. ", " +
  3098. (_vm.height * 0.1 - 7) +
  3099. " " +
  3100. (_vm.width - 9) +
  3101. ", 9 " +
  3102. (_vm.width * 0.9 + 7) +
  3103. ", 9\n "
  3104. }
  3105. }),
  3106. _vm._v(" "),
  3107. _c("polyline", {
  3108. attrs: {
  3109. stroke: "#fff",
  3110. "stroke-width": "3",
  3111. fill: "transparent",
  3112. points:
  3113. "8, " +
  3114. _vm.height * 0.5 +
  3115. " 8, " +
  3116. (_vm.height - 3) +
  3117. " " +
  3118. (_vm.width * 0.3 + 7) +
  3119. ", " +
  3120. (_vm.height - 3)
  3121. }
  3122. }),
  3123. _vm._v(" "),
  3124. _c("polyline", {
  3125. attrs: {
  3126. fill: "#fff",
  3127. points:
  3128. "\n 8, " +
  3129. _vm.height * 0.55 +
  3130. " 8, " +
  3131. _vm.height * 0.7 +
  3132. "\n 2, " +
  3133. (_vm.height * 0.7 - 7) +
  3134. " 2, " +
  3135. (_vm.height * 0.55 + 7) +
  3136. "\n "
  3137. }
  3138. }),
  3139. _vm._v(" "),
  3140. _c("polyline", {
  3141. attrs: {
  3142. stroke: "#fff",
  3143. "stroke-width": "3",
  3144. fill: "transparent",
  3145. points:
  3146. _vm.width * 0.35 +
  3147. ", " +
  3148. (_vm.height - 3) +
  3149. " " +
  3150. (_vm.width - 3) +
  3151. ", " +
  3152. (_vm.height - 3) +
  3153. " " +
  3154. (_vm.width - 3) +
  3155. ", " +
  3156. _vm.height * 0.35
  3157. }
  3158. }),
  3159. _vm._v(" "),
  3160. _c("polyline", {
  3161. attrs: {
  3162. fill: "#fff",
  3163. points:
  3164. "\n " +
  3165. _vm.width * 0.92 +
  3166. ", " +
  3167. (_vm.height - 3) +
  3168. " " +
  3169. (_vm.width - 3) +
  3170. ", " +
  3171. (_vm.height - 3) +
  3172. " " +
  3173. (_vm.width - 3) +
  3174. ", " +
  3175. _vm.height * 0.8 +
  3176. "\n " +
  3177. (_vm.width - 9) +
  3178. ", " +
  3179. (_vm.height * 0.8 + 7) +
  3180. " " +
  3181. (_vm.width - 9) +
  3182. ", " +
  3183. (_vm.height - 9) +
  3184. " " +
  3185. (_vm.width * 0.92 + 7) +
  3186. ", " +
  3187. (_vm.height - 9) +
  3188. "\n "
  3189. }
  3190. })
  3191. ])
  3192. ],
  3193. 1
  3194. ),
  3195. _vm._v(" "),
  3196. _c("polygon", {
  3197. attrs: {
  3198. fill: _vm.backgroundColor,
  3199. points:
  3200. "\n 15, 9 " +
  3201. (_vm.width * 0.1 + 1) +
  3202. ", 9 " +
  3203. (_vm.width * 0.1 + 4) +
  3204. ", 6 " +
  3205. (_vm.width * 0.52 + 2) +
  3206. ", 6\n " +
  3207. (_vm.width * 0.52 + 6) +
  3208. ", 10 " +
  3209. (_vm.width * 0.58 - 7) +
  3210. ", 10 " +
  3211. (_vm.width * 0.58 - 2) +
  3212. ", 6\n " +
  3213. (_vm.width * 0.9 + 2) +
  3214. ", 6 " +
  3215. (_vm.width * 0.9 + 6) +
  3216. ", 10 " +
  3217. (_vm.width - 10) +
  3218. ", 10 " +
  3219. (_vm.width - 10) +
  3220. ", " +
  3221. (_vm.height * 0.1 - 6) +
  3222. "\n " +
  3223. (_vm.width - 6) +
  3224. ", " +
  3225. (_vm.height * 0.1 - 1) +
  3226. " " +
  3227. (_vm.width - 6) +
  3228. ", " +
  3229. (_vm.height * 0.8 + 1) +
  3230. " " +
  3231. (_vm.width - 10) +
  3232. ", " +
  3233. (_vm.height * 0.8 + 6) +
  3234. "\n " +
  3235. (_vm.width - 10) +
  3236. ", " +
  3237. (_vm.height - 10) +
  3238. " " +
  3239. (_vm.width * 0.92 + 7) +
  3240. ", " +
  3241. (_vm.height - 10) +
  3242. " " +
  3243. (_vm.width * 0.92 + 2) +
  3244. ", " +
  3245. (_vm.height - 6) +
  3246. "\n 11, " +
  3247. (_vm.height - 6) +
  3248. " 11, " +
  3249. (_vm.height * 0.15 - 2) +
  3250. " 15, " +
  3251. (_vm.height * 0.15 - 7) +
  3252. "\n "
  3253. }
  3254. }),
  3255. _vm._v(" "),
  3256. _c("rect", {
  3257. attrs: {
  3258. x: "0",
  3259. y: "0",
  3260. width: _vm.width,
  3261. height: _vm.height,
  3262. fill: "url(#" + _vm.gradientId + ")",
  3263. mask: "url(#" + _vm.maskId + ")"
  3264. }
  3265. })
  3266. ]
  3267. ),
  3268. _vm._v(" "),
  3269. _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
  3270. ])
  3271. };
  3272. var __vue_staticRenderFns__$a = [];
  3273. __vue_render__$a._withStripped = true;
  3274. /* style */
  3275. const __vue_inject_styles__$a = function (inject) {
  3276. if (!inject) return
  3277. inject("data-v-db539808_0", { source: ".dv-border-box-9 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-9 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n}\n.dv-border-box-9 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,SAAS;EACT,QAAQ;AACV;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-9 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-9 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n}\n.dv-border-box-9 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  3278. };
  3279. /* scoped */
  3280. const __vue_scope_id__$a = undefined;
  3281. /* module identifier */
  3282. const __vue_module_identifier__$a = undefined;
  3283. /* functional template */
  3284. const __vue_is_functional_template__$a = false;
  3285. /* style inject SSR */
  3286. /* style inject shadow dom */
  3287. const __vue_component__$a = /*#__PURE__*/normalizeComponent(
  3288. { render: __vue_render__$a, staticRenderFns: __vue_staticRenderFns__$a },
  3289. __vue_inject_styles__$a,
  3290. __vue_script__$a,
  3291. __vue_scope_id__$a,
  3292. __vue_is_functional_template__$a,
  3293. __vue_module_identifier__$a,
  3294. false,
  3295. createInjector,
  3296. undefined,
  3297. undefined
  3298. );
  3299. function borderBox9 (Vue) {
  3300. Vue.component(__vue_component__$a.name, __vue_component__$a);
  3301. }
  3302. //
  3303. var script$b = {
  3304. name: 'DvBorderBox10',
  3305. mixins: [autoResize],
  3306. props: {
  3307. color: {
  3308. type: Array,
  3309. default: () => []
  3310. },
  3311. backgroundColor: {
  3312. type: String,
  3313. default: 'transparent'
  3314. }
  3315. },
  3316. data() {
  3317. return {
  3318. ref: 'border-box-10',
  3319. border: ['left-top', 'right-top', 'left-bottom', 'right-bottom'],
  3320. defaultColor: ['#1d48c4', '#d3e1f8'],
  3321. mergedColor: []
  3322. };
  3323. },
  3324. watch: {
  3325. color() {
  3326. const {
  3327. mergeColor
  3328. } = this;
  3329. mergeColor();
  3330. }
  3331. },
  3332. methods: {
  3333. mergeColor() {
  3334. const {
  3335. color,
  3336. defaultColor
  3337. } = this;
  3338. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  3339. }
  3340. },
  3341. mounted() {
  3342. const {
  3343. mergeColor
  3344. } = this;
  3345. mergeColor();
  3346. }
  3347. };
  3348. /* script */
  3349. const __vue_script__$b = script$b;
  3350. /* template */
  3351. var __vue_render__$b = function() {
  3352. var _vm = this;
  3353. var _h = _vm.$createElement;
  3354. var _c = _vm._self._c || _h;
  3355. return _c(
  3356. "div",
  3357. {
  3358. ref: _vm.ref,
  3359. staticClass: "dv-border-box-10",
  3360. style: "box-shadow: inset 0 0 25px 3px " + _vm.mergedColor[0]
  3361. },
  3362. [
  3363. _c(
  3364. "svg",
  3365. {
  3366. staticClass: "dv-border-svg-container",
  3367. attrs: { width: _vm.width, height: _vm.height }
  3368. },
  3369. [
  3370. _c("polygon", {
  3371. attrs: {
  3372. fill: _vm.backgroundColor,
  3373. points:
  3374. "\n 4, 0 " +
  3375. (_vm.width - 4) +
  3376. ", 0 " +
  3377. _vm.width +
  3378. ", 4 " +
  3379. _vm.width +
  3380. ", " +
  3381. (_vm.height - 4) +
  3382. " " +
  3383. (_vm.width - 4) +
  3384. ", " +
  3385. _vm.height +
  3386. "\n 4, " +
  3387. _vm.height +
  3388. " 0, " +
  3389. (_vm.height - 4) +
  3390. " 0, 4\n "
  3391. }
  3392. })
  3393. ]
  3394. ),
  3395. _vm._v(" "),
  3396. _vm._l(_vm.border, function(item) {
  3397. return _c(
  3398. "svg",
  3399. {
  3400. key: item,
  3401. class: item + " dv-border-svg-container",
  3402. attrs: { width: "150px", height: "150px" }
  3403. },
  3404. [
  3405. _c("polygon", {
  3406. attrs: {
  3407. fill: _vm.mergedColor[1],
  3408. points: "40, 0 5, 0 0, 5 0, 16 3, 19 3, 7 7, 3 35, 3"
  3409. }
  3410. })
  3411. ]
  3412. )
  3413. }),
  3414. _vm._v(" "),
  3415. _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
  3416. ],
  3417. 2
  3418. )
  3419. };
  3420. var __vue_staticRenderFns__$b = [];
  3421. __vue_render__$b._withStripped = true;
  3422. /* style */
  3423. const __vue_inject_styles__$b = function (inject) {
  3424. if (!inject) return
  3425. inject("data-v-746a9ff1_0", { source: ".dv-border-box-10 {\n position: relative;\n width: 100%;\n height: 100%;\n border-radius: 6px;\n}\n.dv-border-box-10 .dv-border-svg-container {\n position: absolute;\n display: block;\n}\n.dv-border-box-10 .right-top {\n right: 0px;\n transform: rotateY(180deg);\n}\n.dv-border-box-10 .left-bottom {\n bottom: 0px;\n transform: rotateX(180deg);\n}\n.dv-border-box-10 .right-bottom {\n right: 0px;\n bottom: 0px;\n transform: rotateX(180deg) rotateY(180deg);\n}\n.dv-border-box-10 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,kBAAkB;AACpB;AACA;EACE,kBAAkB;EAClB,cAAc;AAChB;AACA;EACE,UAAU;EACV,0BAA0B;AAC5B;AACA;EACE,WAAW;EACX,0BAA0B;AAC5B;AACA;EACE,UAAU;EACV,WAAW;EACX,0CAA0C;AAC5C;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-10 {\n position: relative;\n width: 100%;\n height: 100%;\n border-radius: 6px;\n}\n.dv-border-box-10 .dv-border-svg-container {\n position: absolute;\n display: block;\n}\n.dv-border-box-10 .right-top {\n right: 0px;\n transform: rotateY(180deg);\n}\n.dv-border-box-10 .left-bottom {\n bottom: 0px;\n transform: rotateX(180deg);\n}\n.dv-border-box-10 .right-bottom {\n right: 0px;\n bottom: 0px;\n transform: rotateX(180deg) rotateY(180deg);\n}\n.dv-border-box-10 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  3426. };
  3427. /* scoped */
  3428. const __vue_scope_id__$b = undefined;
  3429. /* module identifier */
  3430. const __vue_module_identifier__$b = undefined;
  3431. /* functional template */
  3432. const __vue_is_functional_template__$b = false;
  3433. /* style inject SSR */
  3434. /* style inject shadow dom */
  3435. const __vue_component__$b = /*#__PURE__*/normalizeComponent(
  3436. { render: __vue_render__$b, staticRenderFns: __vue_staticRenderFns__$b },
  3437. __vue_inject_styles__$b,
  3438. __vue_script__$b,
  3439. __vue_scope_id__$b,
  3440. __vue_is_functional_template__$b,
  3441. __vue_module_identifier__$b,
  3442. false,
  3443. createInjector,
  3444. undefined,
  3445. undefined
  3446. );
  3447. function borderBox10 (Vue) {
  3448. Vue.component(__vue_component__$b.name, __vue_component__$b);
  3449. }
  3450. var keywords = createCommonjsModule(function (module, exports) {
  3451. Object.defineProperty(exports, "__esModule", {
  3452. value: true
  3453. });
  3454. exports["default"] = void 0;
  3455. var _default = new Map([['transparent', 'rgba(0,0,0,0)'], ['black', '#000000'], ['silver', '#C0C0C0'], ['gray', '#808080'], ['white', '#FFFFFF'], ['maroon', '#800000'], ['red', '#FF0000'], ['purple', '#800080'], ['fuchsia', '#FF00FF'], ['green', '#008000'], ['lime', '#00FF00'], ['olive', '#808000'], ['yellow', '#FFFF00'], ['navy', '#000080'], ['blue', '#0000FF'], ['teal', '#008080'], ['aqua', '#00FFFF'], ['aliceblue', '#f0f8ff'], ['antiquewhite', '#faebd7'], ['aquamarine', '#7fffd4'], ['azure', '#f0ffff'], ['beige', '#f5f5dc'], ['bisque', '#ffe4c4'], ['blanchedalmond', '#ffebcd'], ['blueviolet', '#8a2be2'], ['brown', '#a52a2a'], ['burlywood', '#deb887'], ['cadetblue', '#5f9ea0'], ['chartreuse', '#7fff00'], ['chocolate', '#d2691e'], ['coral', '#ff7f50'], ['cornflowerblue', '#6495ed'], ['cornsilk', '#fff8dc'], ['crimson', '#dc143c'], ['cyan', '#00ffff'], ['darkblue', '#00008b'], ['darkcyan', '#008b8b'], ['darkgoldenrod', '#b8860b'], ['darkgray', '#a9a9a9'], ['darkgreen', '#006400'], ['darkgrey', '#a9a9a9'], ['darkkhaki', '#bdb76b'], ['darkmagenta', '#8b008b'], ['darkolivegreen', '#556b2f'], ['darkorange', '#ff8c00'], ['darkorchid', '#9932cc'], ['darkred', '#8b0000'], ['darksalmon', '#e9967a'], ['darkseagreen', '#8fbc8f'], ['darkslateblue', '#483d8b'], ['darkslategray', '#2f4f4f'], ['darkslategrey', '#2f4f4f'], ['darkturquoise', '#00ced1'], ['darkviolet', '#9400d3'], ['deeppink', '#ff1493'], ['deepskyblue', '#00bfff'], ['dimgray', '#696969'], ['dimgrey', '#696969'], ['dodgerblue', '#1e90ff'], ['firebrick', '#b22222'], ['floralwhite', '#fffaf0'], ['forestgreen', '#228b22'], ['gainsboro', '#dcdcdc'], ['ghostwhite', '#f8f8ff'], ['gold', '#ffd700'], ['goldenrod', '#daa520'], ['greenyellow', '#adff2f'], ['grey', '#808080'], ['honeydew', '#f0fff0'], ['hotpink', '#ff69b4'], ['indianred', '#cd5c5c'], ['indigo', '#4b0082'], ['ivory', '#fffff0'], ['khaki', '#f0e68c'], ['lavender', '#e6e6fa'], ['lavenderblush', '#fff0f5'], ['lawngreen', '#7cfc00'], ['lemonchiffon', '#fffacd'], ['lightblue', '#add8e6'], ['lightcoral', '#f08080'], ['lightcyan', '#e0ffff'], ['lightgoldenrodyellow', '#fafad2'], ['lightgray', '#d3d3d3'], ['lightgreen', '#90ee90'], ['lightgrey', '#d3d3d3'], ['lightpink', '#ffb6c1'], ['lightsalmon', '#ffa07a'], ['lightseagreen', '#20b2aa'], ['lightskyblue', '#87cefa'], ['lightslategray', '#778899'], ['lightslategrey', '#778899'], ['lightsteelblue', '#b0c4de'], ['lightyellow', '#ffffe0'], ['limegreen', '#32cd32'], ['linen', '#faf0e6'], ['magenta', '#ff00ff'], ['mediumaquamarine', '#66cdaa'], ['mediumblue', '#0000cd'], ['mediumorchid', '#ba55d3'], ['mediumpurple', '#9370db'], ['mediumseagreen', '#3cb371'], ['mediumslateblue', '#7b68ee'], ['mediumspringgreen', '#00fa9a'], ['mediumturquoise', '#48d1cc'], ['mediumvioletred', '#c71585'], ['midnightblue', '#191970'], ['mintcream', '#f5fffa'], ['mistyrose', '#ffe4e1'], ['moccasin', '#ffe4b5'], ['navajowhite', '#ffdead'], ['oldlace', '#fdf5e6'], ['olivedrab', '#6b8e23'], ['orange', '#ffa500'], ['orangered', '#ff4500'], ['orchid', '#da70d6'], ['palegoldenrod', '#eee8aa'], ['palegreen', '#98fb98'], ['paleturquoise', '#afeeee'], ['palevioletred', '#db7093'], ['papayawhip', '#ffefd5'], ['peachpuff', '#ffdab9'], ['peru', '#cd853f'], ['pink', '#ffc0cb'], ['plum', '#dda0dd'], ['powderblue', '#b0e0e6'], ['rosybrown', '#bc8f8f'], ['royalblue', '#4169e1'], ['saddlebrown', '#8b4513'], ['salmon', '#fa8072'], ['sandybrown', '#f4a460'], ['seagreen', '#2e8b57'], ['seashell', '#fff5ee'], ['sienna', '#a0522d'], ['skyblue', '#87ceeb'], ['slateblue', '#6a5acd'], ['slategray', '#708090'], ['slategrey', '#708090'], ['snow', '#fffafa'], ['springgreen', '#00ff7f'], ['steelblue', '#4682b4'], ['tan', '#d2b48c'], ['thistle', '#d8bfd8'], ['tomato', '#ff6347'], ['turquoise', '#40e0d0'], ['violet', '#ee82ee'], ['wheat', '#f5deb3'], ['whitesmoke', '#f5f5f5'], ['yellowgreen', '#9acd32']]);
  3456. exports["default"] = _default;
  3457. });
  3458. unwrapExports(keywords);
  3459. var lib = createCommonjsModule(function (module, exports) {
  3460. Object.defineProperty(exports, "__esModule", {
  3461. value: true
  3462. });
  3463. exports.getRgbValue = getRgbValue;
  3464. exports.getRgbaValue = getRgbaValue;
  3465. exports.getOpacity = getOpacity;
  3466. exports.toRgb = toRgb;
  3467. exports.toHex = toHex;
  3468. exports.getColorFromRgbValue = getColorFromRgbValue;
  3469. exports.darken = darken;
  3470. exports.lighten = lighten;
  3471. exports.fade = fade;
  3472. exports["default"] = void 0;
  3473. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  3474. var _keywords = interopRequireDefault(keywords);
  3475. var hexReg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  3476. var rgbReg = /^(rgb|rgba|RGB|RGBA)/;
  3477. var rgbaReg = /^(rgba|RGBA)/;
  3478. /**
  3479. * @description Color validator
  3480. * @param {String} color Hex|Rgb|Rgba color or color keyword
  3481. * @return {String|Boolean} Valid color Or false
  3482. */
  3483. function validator(color) {
  3484. var isHex = hexReg.test(color);
  3485. var isRgb = rgbReg.test(color);
  3486. if (isHex || isRgb) return color;
  3487. color = getColorByKeyword(color);
  3488. if (!color) {
  3489. console.error('Color: Invalid color!');
  3490. return false;
  3491. }
  3492. return color;
  3493. }
  3494. /**
  3495. * @description Get color by keyword
  3496. * @param {String} keyword Color keyword like red, green and etc.
  3497. * @return {String|Boolean} Hex or rgba color (Invalid keyword will return false)
  3498. */
  3499. function getColorByKeyword(keyword) {
  3500. if (!keyword) {
  3501. console.error('getColorByKeywords: Missing parameters!');
  3502. return false;
  3503. }
  3504. if (!_keywords["default"].has(keyword)) return false;
  3505. return _keywords["default"].get(keyword);
  3506. }
  3507. /**
  3508. * @description Get the Rgb value of the color
  3509. * @param {String} color Hex|Rgb|Rgba color or color keyword
  3510. * @return {Array<Number>|Boolean} Rgb value of the color (Invalid input will return false)
  3511. */
  3512. function getRgbValue(color) {
  3513. if (!color) {
  3514. console.error('getRgbValue: Missing parameters!');
  3515. return false;
  3516. }
  3517. color = validator(color);
  3518. if (!color) return false;
  3519. var isHex = hexReg.test(color);
  3520. var isRgb = rgbReg.test(color);
  3521. var lowerColor = color.toLowerCase();
  3522. if (isHex) return getRgbValueFromHex(lowerColor);
  3523. if (isRgb) return getRgbValueFromRgb(lowerColor);
  3524. }
  3525. /**
  3526. * @description Get the rgb value of the hex color
  3527. * @param {String} color Hex color
  3528. * @return {Array<Number>} Rgb value of the color
  3529. */
  3530. function getRgbValueFromHex(color) {
  3531. color = color.replace('#', '');
  3532. if (color.length === 3) color = Array.from(color).map(function (hexNum) {
  3533. return hexNum + hexNum;
  3534. }).join('');
  3535. color = color.split('');
  3536. return new Array(3).fill(0).map(function (t, i) {
  3537. return parseInt("0x".concat(color[i * 2]).concat(color[i * 2 + 1]));
  3538. });
  3539. }
  3540. /**
  3541. * @description Get the rgb value of the rgb/rgba color
  3542. * @param {String} color Hex color
  3543. * @return {Array} Rgb value of the color
  3544. */
  3545. function getRgbValueFromRgb(color) {
  3546. return color.replace(/rgb\(|rgba\(|\)/g, '').split(',').slice(0, 3).map(function (n) {
  3547. return parseInt(n);
  3548. });
  3549. }
  3550. /**
  3551. * @description Get the Rgba value of the color
  3552. * @param {String} color Hex|Rgb|Rgba color or color keyword
  3553. * @return {Array<Number>|Boolean} Rgba value of the color (Invalid input will return false)
  3554. */
  3555. function getRgbaValue(color) {
  3556. if (!color) {
  3557. console.error('getRgbaValue: Missing parameters!');
  3558. return false;
  3559. }
  3560. var colorValue = getRgbValue(color);
  3561. if (!colorValue) return false;
  3562. colorValue.push(getOpacity(color));
  3563. return colorValue;
  3564. }
  3565. /**
  3566. * @description Get the opacity of color
  3567. * @param {String} color Hex|Rgb|Rgba color or color keyword
  3568. * @return {Number|Boolean} Color opacity (Invalid input will return false)
  3569. */
  3570. function getOpacity(color) {
  3571. if (!color) {
  3572. console.error('getOpacity: Missing parameters!');
  3573. return false;
  3574. }
  3575. color = validator(color);
  3576. if (!color) return false;
  3577. var isRgba = rgbaReg.test(color);
  3578. if (!isRgba) return 1;
  3579. color = color.toLowerCase();
  3580. return Number(color.split(',').slice(-1)[0].replace(/[)|\s]/g, ''));
  3581. }
  3582. /**
  3583. * @description Convert color to Rgb|Rgba color
  3584. * @param {String} color Hex|Rgb|Rgba color or color keyword
  3585. * @param {Number} opacity The opacity of color
  3586. * @return {String|Boolean} Rgb|Rgba color (Invalid input will return false)
  3587. */
  3588. function toRgb(color, opacity) {
  3589. if (!color) {
  3590. console.error('toRgb: Missing parameters!');
  3591. return false;
  3592. }
  3593. var rgbValue = getRgbValue(color);
  3594. if (!rgbValue) return false;
  3595. var addOpacity = typeof opacity === 'number';
  3596. if (addOpacity) return 'rgba(' + rgbValue.join(',') + ",".concat(opacity, ")");
  3597. return 'rgb(' + rgbValue.join(',') + ')';
  3598. }
  3599. /**
  3600. * @description Convert color to Hex color
  3601. * @param {String} color Hex|Rgb|Rgba color or color keyword
  3602. * @return {String|Boolean} Hex color (Invalid input will return false)
  3603. */
  3604. function toHex(color) {
  3605. if (!color) {
  3606. console.error('toHex: Missing parameters!');
  3607. return false;
  3608. }
  3609. if (hexReg.test(color)) return color;
  3610. color = getRgbValue(color);
  3611. if (!color) return false;
  3612. return '#' + color.map(function (n) {
  3613. return Number(n).toString(16);
  3614. }).map(function (n) {
  3615. return n === '0' ? '00' : n;
  3616. }).join('');
  3617. }
  3618. /**
  3619. * @description Get Color from Rgb|Rgba value
  3620. * @param {Array<Number>} value Rgb|Rgba color value
  3621. * @return {String|Boolean} Rgb|Rgba color (Invalid input will return false)
  3622. */
  3623. function getColorFromRgbValue(value) {
  3624. if (!value) {
  3625. console.error('getColorFromRgbValue: Missing parameters!');
  3626. return false;
  3627. }
  3628. var valueLength = value.length;
  3629. if (valueLength !== 3 && valueLength !== 4) {
  3630. console.error('getColorFromRgbValue: Value is illegal!');
  3631. return false;
  3632. }
  3633. var color = valueLength === 3 ? 'rgb(' : 'rgba(';
  3634. color += value.join(',') + ')';
  3635. return color;
  3636. }
  3637. /**
  3638. * @description Deepen color
  3639. * @param {String} color Hex|Rgb|Rgba color or color keyword
  3640. * @return {Number} Percent of Deepen (1-100)
  3641. * @return {String|Boolean} Rgba color (Invalid input will return false)
  3642. */
  3643. function darken(color) {
  3644. var percent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  3645. if (!color) {
  3646. console.error('darken: Missing parameters!');
  3647. return false;
  3648. }
  3649. var rgbaValue = getRgbaValue(color);
  3650. if (!rgbaValue) return false;
  3651. rgbaValue = rgbaValue.map(function (v, i) {
  3652. return i === 3 ? v : v - Math.ceil(2.55 * percent);
  3653. }).map(function (v) {
  3654. return v < 0 ? 0 : v;
  3655. });
  3656. return getColorFromRgbValue(rgbaValue);
  3657. }
  3658. /**
  3659. * @description Brighten color
  3660. * @param {String} color Hex|Rgb|Rgba color or color keyword
  3661. * @return {Number} Percent of brighten (1-100)
  3662. * @return {String|Boolean} Rgba color (Invalid input will return false)
  3663. */
  3664. function lighten(color) {
  3665. var percent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  3666. if (!color) {
  3667. console.error('lighten: Missing parameters!');
  3668. return false;
  3669. }
  3670. var rgbaValue = getRgbaValue(color);
  3671. if (!rgbaValue) return false;
  3672. rgbaValue = rgbaValue.map(function (v, i) {
  3673. return i === 3 ? v : v + Math.ceil(2.55 * percent);
  3674. }).map(function (v) {
  3675. return v > 255 ? 255 : v;
  3676. });
  3677. return getColorFromRgbValue(rgbaValue);
  3678. }
  3679. /**
  3680. * @description Adjust color opacity
  3681. * @param {String} color Hex|Rgb|Rgba color or color keyword
  3682. * @param {Number} Percent of opacity
  3683. * @return {String|Boolean} Rgba color (Invalid input will return false)
  3684. */
  3685. function fade(color) {
  3686. var percent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
  3687. if (!color) {
  3688. console.error('fade: Missing parameters!');
  3689. return false;
  3690. }
  3691. var rgbValue = getRgbValue(color);
  3692. if (!rgbValue) return false;
  3693. var rgbaValue = [].concat((0, _toConsumableArray2["default"])(rgbValue), [percent / 100]);
  3694. return getColorFromRgbValue(rgbaValue);
  3695. }
  3696. var _default = {
  3697. fade: fade,
  3698. toHex: toHex,
  3699. toRgb: toRgb,
  3700. darken: darken,
  3701. lighten: lighten,
  3702. getOpacity: getOpacity,
  3703. getRgbValue: getRgbValue,
  3704. getRgbaValue: getRgbaValue,
  3705. getColorFromRgbValue: getColorFromRgbValue
  3706. };
  3707. exports["default"] = _default;
  3708. });
  3709. unwrapExports(lib);
  3710. var lib_1 = lib.getRgbValue;
  3711. var lib_2 = lib.getRgbaValue;
  3712. var lib_3 = lib.getOpacity;
  3713. var lib_4 = lib.toRgb;
  3714. var lib_5 = lib.toHex;
  3715. var lib_6 = lib.getColorFromRgbValue;
  3716. var lib_7 = lib.darken;
  3717. var lib_8 = lib.lighten;
  3718. var lib_9 = lib.fade;
  3719. //
  3720. var script$c = {
  3721. name: 'DvBorderBox11',
  3722. mixins: [autoResize],
  3723. props: {
  3724. color: {
  3725. type: Array,
  3726. default: () => []
  3727. },
  3728. titleWidth: {
  3729. type: Number,
  3730. default: 250
  3731. },
  3732. title: {
  3733. type: String,
  3734. default: ''
  3735. },
  3736. backgroundColor: {
  3737. type: String,
  3738. default: 'transparent'
  3739. }
  3740. },
  3741. data() {
  3742. const id = uuid();
  3743. return {
  3744. ref: 'border-box-11',
  3745. filterId: `border-box-11-filterId-${id}`,
  3746. defaultColor: ['#8aaafb', '#1f33a2'],
  3747. mergedColor: []
  3748. };
  3749. },
  3750. watch: {
  3751. color() {
  3752. const {
  3753. mergeColor
  3754. } = this;
  3755. mergeColor();
  3756. }
  3757. },
  3758. methods: {
  3759. mergeColor() {
  3760. const {
  3761. color,
  3762. defaultColor
  3763. } = this;
  3764. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  3765. },
  3766. fade: lib_9
  3767. },
  3768. mounted() {
  3769. const {
  3770. mergeColor
  3771. } = this;
  3772. mergeColor();
  3773. }
  3774. };
  3775. /* script */
  3776. const __vue_script__$c = script$c;
  3777. /* template */
  3778. var __vue_render__$c = function() {
  3779. var _vm = this;
  3780. var _h = _vm.$createElement;
  3781. var _c = _vm._self._c || _h;
  3782. return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-11" }, [
  3783. _c(
  3784. "svg",
  3785. {
  3786. staticClass: "dv-border-svg-container",
  3787. attrs: { width: _vm.width, height: _vm.height }
  3788. },
  3789. [
  3790. _c("defs", [
  3791. _c(
  3792. "filter",
  3793. {
  3794. attrs: {
  3795. id: _vm.filterId,
  3796. height: "150%",
  3797. width: "150%",
  3798. x: "-25%",
  3799. y: "-25%"
  3800. }
  3801. },
  3802. [
  3803. _c("feMorphology", {
  3804. attrs: {
  3805. operator: "dilate",
  3806. radius: "2",
  3807. in: "SourceAlpha",
  3808. result: "thicken"
  3809. }
  3810. }),
  3811. _vm._v(" "),
  3812. _c("feGaussianBlur", {
  3813. attrs: { in: "thicken", stdDeviation: "3", result: "blurred" }
  3814. }),
  3815. _vm._v(" "),
  3816. _c("feFlood", {
  3817. attrs: {
  3818. "flood-color": _vm.mergedColor[1],
  3819. result: "glowColor"
  3820. }
  3821. }),
  3822. _vm._v(" "),
  3823. _c("feComposite", {
  3824. attrs: {
  3825. in: "glowColor",
  3826. in2: "blurred",
  3827. operator: "in",
  3828. result: "softGlowColored"
  3829. }
  3830. }),
  3831. _vm._v(" "),
  3832. _c(
  3833. "feMerge",
  3834. [
  3835. _c("feMergeNode", { attrs: { in: "softGlowColored" } }),
  3836. _vm._v(" "),
  3837. _c("feMergeNode", { attrs: { in: "SourceGraphic" } })
  3838. ],
  3839. 1
  3840. )
  3841. ],
  3842. 1
  3843. )
  3844. ]),
  3845. _vm._v(" "),
  3846. _c("polygon", {
  3847. attrs: {
  3848. fill: _vm.backgroundColor,
  3849. points:
  3850. "\n 20, 32 " +
  3851. (_vm.width * 0.5 - _vm.titleWidth / 2) +
  3852. ", 32 " +
  3853. (_vm.width * 0.5 - _vm.titleWidth / 2 + 20) +
  3854. ", 53\n " +
  3855. (_vm.width * 0.5 + _vm.titleWidth / 2 - 20) +
  3856. ", 53 " +
  3857. (_vm.width * 0.5 + _vm.titleWidth / 2) +
  3858. ", 32\n " +
  3859. (_vm.width - 20) +
  3860. ", 32 " +
  3861. (_vm.width - 8) +
  3862. ", 48 " +
  3863. (_vm.width - 8) +
  3864. ", " +
  3865. (_vm.height - 25) +
  3866. " " +
  3867. (_vm.width - 20) +
  3868. ", " +
  3869. (_vm.height - 8) +
  3870. "\n 20, " +
  3871. (_vm.height - 8) +
  3872. " 8, " +
  3873. (_vm.height - 25) +
  3874. " 8, 50\n "
  3875. }
  3876. }),
  3877. _vm._v(" "),
  3878. _c("polyline", {
  3879. attrs: {
  3880. stroke: _vm.mergedColor[0],
  3881. filter: "url(#" + _vm.filterId + ")",
  3882. points:
  3883. "\n " +
  3884. (_vm.width - _vm.titleWidth) / 2 +
  3885. ", 30\n 20, 30 7, 50 7, " +
  3886. (50 + (_vm.height - 167) / 2) +
  3887. "\n 13, " +
  3888. (55 + (_vm.height - 167) / 2) +
  3889. " 13, " +
  3890. (135 + (_vm.height - 167) / 2) +
  3891. "\n 7, " +
  3892. (140 + (_vm.height - 167) / 2) +
  3893. " 7, " +
  3894. (_vm.height - 27) +
  3895. "\n 20, " +
  3896. (_vm.height - 7) +
  3897. " " +
  3898. (_vm.width - 20) +
  3899. ", " +
  3900. (_vm.height - 7) +
  3901. " " +
  3902. (_vm.width - 7) +
  3903. ", " +
  3904. (_vm.height - 27) +
  3905. "\n " +
  3906. (_vm.width - 7) +
  3907. ", " +
  3908. (140 + (_vm.height - 167) / 2) +
  3909. " " +
  3910. (_vm.width - 13) +
  3911. ", " +
  3912. (135 + (_vm.height - 167) / 2) +
  3913. "\n " +
  3914. (_vm.width - 13) +
  3915. ", " +
  3916. (55 + (_vm.height - 167) / 2) +
  3917. " " +
  3918. (_vm.width - 7) +
  3919. ", " +
  3920. (50 + (_vm.height - 167) / 2) +
  3921. "\n " +
  3922. (_vm.width - 7) +
  3923. ", 50 " +
  3924. (_vm.width - 20) +
  3925. ", 30 " +
  3926. (_vm.width + _vm.titleWidth) / 2 +
  3927. ", 30\n " +
  3928. ((_vm.width + _vm.titleWidth) / 2 - 20) +
  3929. ", 7 " +
  3930. ((_vm.width - _vm.titleWidth) / 2 + 20) +
  3931. ", 7\n " +
  3932. (_vm.width - _vm.titleWidth) / 2 +
  3933. ", 30 " +
  3934. ((_vm.width - _vm.titleWidth) / 2 + 20) +
  3935. ", 52\n " +
  3936. ((_vm.width + _vm.titleWidth) / 2 - 20) +
  3937. ", 52 " +
  3938. (_vm.width + _vm.titleWidth) / 2 +
  3939. ", 30\n "
  3940. }
  3941. }),
  3942. _vm._v(" "),
  3943. _c("polygon", {
  3944. attrs: {
  3945. stroke: _vm.mergedColor[0],
  3946. fill: "transparent",
  3947. points:
  3948. "\n " +
  3949. ((_vm.width + _vm.titleWidth) / 2 - 5) +
  3950. ", 30 " +
  3951. ((_vm.width + _vm.titleWidth) / 2 - 21) +
  3952. ", 11\n " +
  3953. ((_vm.width + _vm.titleWidth) / 2 - 27) +
  3954. ", 11 " +
  3955. ((_vm.width + _vm.titleWidth) / 2 - 8) +
  3956. ", 34\n "
  3957. }
  3958. }),
  3959. _vm._v(" "),
  3960. _c("polygon", {
  3961. attrs: {
  3962. stroke: _vm.mergedColor[0],
  3963. fill: "transparent",
  3964. points:
  3965. "\n " +
  3966. ((_vm.width - _vm.titleWidth) / 2 + 5) +
  3967. ", 30 " +
  3968. ((_vm.width - _vm.titleWidth) / 2 + 22) +
  3969. ", 49\n " +
  3970. ((_vm.width - _vm.titleWidth) / 2 + 28) +
  3971. ", 49 " +
  3972. ((_vm.width - _vm.titleWidth) / 2 + 8) +
  3973. ", 26\n "
  3974. }
  3975. }),
  3976. _vm._v(" "),
  3977. _c("polygon", {
  3978. attrs: {
  3979. stroke: _vm.mergedColor[0],
  3980. fill: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 30),
  3981. filter: "url(#" + _vm.filterId + ")",
  3982. points:
  3983. "\n " +
  3984. ((_vm.width + _vm.titleWidth) / 2 - 11) +
  3985. ", 37 " +
  3986. ((_vm.width + _vm.titleWidth) / 2 - 32) +
  3987. ", 11\n " +
  3988. ((_vm.width - _vm.titleWidth) / 2 + 23) +
  3989. ", 11 " +
  3990. ((_vm.width - _vm.titleWidth) / 2 + 11) +
  3991. ", 23\n " +
  3992. ((_vm.width - _vm.titleWidth) / 2 + 33) +
  3993. ", 49 " +
  3994. ((_vm.width + _vm.titleWidth) / 2 - 22) +
  3995. ", 49\n "
  3996. }
  3997. }),
  3998. _vm._v(" "),
  3999. _c(
  4000. "polygon",
  4001. {
  4002. attrs: {
  4003. filter: "url(#" + _vm.filterId + ")",
  4004. fill: _vm.mergedColor[0],
  4005. opacity: "1",
  4006. points:
  4007. "\n " +
  4008. ((_vm.width - _vm.titleWidth) / 2 - 10) +
  4009. ", 37 " +
  4010. ((_vm.width - _vm.titleWidth) / 2 - 31) +
  4011. ", 37\n " +
  4012. ((_vm.width - _vm.titleWidth) / 2 - 25) +
  4013. ", 46 " +
  4014. ((_vm.width - _vm.titleWidth) / 2 - 4) +
  4015. ", 46\n "
  4016. }
  4017. },
  4018. [
  4019. _c("animate", {
  4020. attrs: {
  4021. attributeName: "opacity",
  4022. values: "1;0.7;1",
  4023. dur: "2s",
  4024. begin: "0s",
  4025. repeatCount: "indefinite"
  4026. }
  4027. })
  4028. ]
  4029. ),
  4030. _vm._v(" "),
  4031. _c(
  4032. "polygon",
  4033. {
  4034. attrs: {
  4035. filter: "url(#" + _vm.filterId + ")",
  4036. fill: _vm.mergedColor[0],
  4037. opacity: "0.7",
  4038. points:
  4039. "\n " +
  4040. ((_vm.width - _vm.titleWidth) / 2 - 40) +
  4041. ", 37 " +
  4042. ((_vm.width - _vm.titleWidth) / 2 - 61) +
  4043. ", 37\n " +
  4044. ((_vm.width - _vm.titleWidth) / 2 - 55) +
  4045. ", 46 " +
  4046. ((_vm.width - _vm.titleWidth) / 2 - 34) +
  4047. ", 46\n "
  4048. }
  4049. },
  4050. [
  4051. _c("animate", {
  4052. attrs: {
  4053. attributeName: "opacity",
  4054. values: "0.7;0.4;0.7",
  4055. dur: "2s",
  4056. begin: "0s",
  4057. repeatCount: "indefinite"
  4058. }
  4059. })
  4060. ]
  4061. ),
  4062. _vm._v(" "),
  4063. _c(
  4064. "polygon",
  4065. {
  4066. attrs: {
  4067. filter: "url(#" + _vm.filterId + ")",
  4068. fill: _vm.mergedColor[0],
  4069. opacity: "0.5",
  4070. points:
  4071. "\n " +
  4072. ((_vm.width - _vm.titleWidth) / 2 - 70) +
  4073. ", 37 " +
  4074. ((_vm.width - _vm.titleWidth) / 2 - 91) +
  4075. ", 37\n " +
  4076. ((_vm.width - _vm.titleWidth) / 2 - 85) +
  4077. ", 46 " +
  4078. ((_vm.width - _vm.titleWidth) / 2 - 64) +
  4079. ", 46\n "
  4080. }
  4081. },
  4082. [
  4083. _c("animate", {
  4084. attrs: {
  4085. attributeName: "opacity",
  4086. values: "0.5;0.2;0.5",
  4087. dur: "2s",
  4088. begin: "0s",
  4089. repeatCount: "indefinite"
  4090. }
  4091. })
  4092. ]
  4093. ),
  4094. _vm._v(" "),
  4095. _c(
  4096. "polygon",
  4097. {
  4098. attrs: {
  4099. filter: "url(#" + _vm.filterId + ")",
  4100. fill: _vm.mergedColor[0],
  4101. opacity: "1",
  4102. points:
  4103. "\n " +
  4104. ((_vm.width + _vm.titleWidth) / 2 + 30) +
  4105. ", 37 " +
  4106. ((_vm.width + _vm.titleWidth) / 2 + 9) +
  4107. ", 37\n " +
  4108. ((_vm.width + _vm.titleWidth) / 2 + 3) +
  4109. ", 46 " +
  4110. ((_vm.width + _vm.titleWidth) / 2 + 24) +
  4111. ", 46\n "
  4112. }
  4113. },
  4114. [
  4115. _c("animate", {
  4116. attrs: {
  4117. attributeName: "opacity",
  4118. values: "1;0.7;1",
  4119. dur: "2s",
  4120. begin: "0s",
  4121. repeatCount: "indefinite"
  4122. }
  4123. })
  4124. ]
  4125. ),
  4126. _vm._v(" "),
  4127. _c(
  4128. "polygon",
  4129. {
  4130. attrs: {
  4131. filter: "url(#" + _vm.filterId + ")",
  4132. fill: _vm.mergedColor[0],
  4133. opacity: "0.7",
  4134. points:
  4135. "\n " +
  4136. ((_vm.width + _vm.titleWidth) / 2 + 60) +
  4137. ", 37 " +
  4138. ((_vm.width + _vm.titleWidth) / 2 + 39) +
  4139. ", 37\n " +
  4140. ((_vm.width + _vm.titleWidth) / 2 + 33) +
  4141. ", 46 " +
  4142. ((_vm.width + _vm.titleWidth) / 2 + 54) +
  4143. ", 46\n "
  4144. }
  4145. },
  4146. [
  4147. _c("animate", {
  4148. attrs: {
  4149. attributeName: "opacity",
  4150. values: "0.7;0.4;0.7",
  4151. dur: "2s",
  4152. begin: "0s",
  4153. repeatCount: "indefinite"
  4154. }
  4155. })
  4156. ]
  4157. ),
  4158. _vm._v(" "),
  4159. _c(
  4160. "polygon",
  4161. {
  4162. attrs: {
  4163. filter: "url(#" + _vm.filterId + ")",
  4164. fill: _vm.mergedColor[0],
  4165. opacity: "0.5",
  4166. points:
  4167. "\n " +
  4168. ((_vm.width + _vm.titleWidth) / 2 + 90) +
  4169. ", 37 " +
  4170. ((_vm.width + _vm.titleWidth) / 2 + 69) +
  4171. ", 37\n " +
  4172. ((_vm.width + _vm.titleWidth) / 2 + 63) +
  4173. ", 46 " +
  4174. ((_vm.width + _vm.titleWidth) / 2 + 84) +
  4175. ", 46\n "
  4176. }
  4177. },
  4178. [
  4179. _c("animate", {
  4180. attrs: {
  4181. attributeName: "opacity",
  4182. values: "0.5;0.2;0.5",
  4183. dur: "2s",
  4184. begin: "0s",
  4185. repeatCount: "indefinite"
  4186. }
  4187. })
  4188. ]
  4189. ),
  4190. _vm._v(" "),
  4191. _c(
  4192. "text",
  4193. {
  4194. staticClass: "dv-border-box-11-title",
  4195. attrs: {
  4196. x: "" + _vm.width / 2,
  4197. y: "32",
  4198. fill: "#fff",
  4199. "font-size": "18",
  4200. "text-anchor": "middle",
  4201. "dominant-baseline": "middle"
  4202. }
  4203. },
  4204. [_vm._v("\n " + _vm._s(_vm.title) + "\n ")]
  4205. ),
  4206. _vm._v(" "),
  4207. _c("polygon", {
  4208. attrs: {
  4209. fill: _vm.mergedColor[0],
  4210. filter: "url(#" + _vm.filterId + ")",
  4211. points:
  4212. "\n 7, " +
  4213. (53 + (_vm.height - 167) / 2) +
  4214. " 11, " +
  4215. (57 + (_vm.height - 167) / 2) +
  4216. "\n 11, " +
  4217. (133 + (_vm.height - 167) / 2) +
  4218. " 7, " +
  4219. (137 + (_vm.height - 167) / 2) +
  4220. "\n "
  4221. }
  4222. }),
  4223. _vm._v(" "),
  4224. _c("polygon", {
  4225. attrs: {
  4226. fill: _vm.mergedColor[0],
  4227. filter: "url(#" + _vm.filterId + ")",
  4228. points:
  4229. "\n " +
  4230. (_vm.width - 7) +
  4231. ", " +
  4232. (53 + (_vm.height - 167) / 2) +
  4233. " " +
  4234. (_vm.width - 11) +
  4235. ", " +
  4236. (57 + (_vm.height - 167) / 2) +
  4237. "\n " +
  4238. (_vm.width - 11) +
  4239. ", " +
  4240. (133 + (_vm.height - 167) / 2) +
  4241. " " +
  4242. (_vm.width - 7) +
  4243. ", " +
  4244. (137 + (_vm.height - 167) / 2) +
  4245. "\n "
  4246. }
  4247. })
  4248. ]
  4249. ),
  4250. _vm._v(" "),
  4251. _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
  4252. ])
  4253. };
  4254. var __vue_staticRenderFns__$c = [];
  4255. __vue_render__$c._withStripped = true;
  4256. /* style */
  4257. const __vue_inject_styles__$c = function (inject) {
  4258. if (!inject) return
  4259. inject("data-v-10f995ec_0", { source: ".dv-border-box-11 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-11 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-11 .dv-border-svg-container > polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-11 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,UAAU;EACV,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-11 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-11 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-11 .dv-border-svg-container > polyline {\n fill: none;\n stroke-width: 1;\n}\n.dv-border-box-11 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  4260. };
  4261. /* scoped */
  4262. const __vue_scope_id__$c = undefined;
  4263. /* module identifier */
  4264. const __vue_module_identifier__$c = undefined;
  4265. /* functional template */
  4266. const __vue_is_functional_template__$c = false;
  4267. /* style inject SSR */
  4268. /* style inject shadow dom */
  4269. const __vue_component__$c = /*#__PURE__*/normalizeComponent(
  4270. { render: __vue_render__$c, staticRenderFns: __vue_staticRenderFns__$c },
  4271. __vue_inject_styles__$c,
  4272. __vue_script__$c,
  4273. __vue_scope_id__$c,
  4274. __vue_is_functional_template__$c,
  4275. __vue_module_identifier__$c,
  4276. false,
  4277. createInjector,
  4278. undefined,
  4279. undefined
  4280. );
  4281. function borderBox11 (Vue) {
  4282. Vue.component(__vue_component__$c.name, __vue_component__$c);
  4283. }
  4284. //
  4285. var script$d = {
  4286. name: 'DvBorderBox12',
  4287. mixins: [autoResize],
  4288. props: {
  4289. color: {
  4290. type: Array,
  4291. default: () => []
  4292. },
  4293. backgroundColor: {
  4294. type: String,
  4295. default: 'transparent'
  4296. }
  4297. },
  4298. data() {
  4299. const id = uuid();
  4300. return {
  4301. ref: 'border-box-12',
  4302. filterId: `borderr-box-12-filterId-${id}`,
  4303. defaultColor: ['#2e6099', '#7ce7fd'],
  4304. mergedColor: []
  4305. };
  4306. },
  4307. watch: {
  4308. color() {
  4309. const {
  4310. mergeColor
  4311. } = this;
  4312. mergeColor();
  4313. }
  4314. },
  4315. methods: {
  4316. mergeColor() {
  4317. const {
  4318. color,
  4319. defaultColor
  4320. } = this;
  4321. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  4322. },
  4323. fade: lib_9
  4324. },
  4325. mounted() {
  4326. const {
  4327. mergeColor
  4328. } = this;
  4329. mergeColor();
  4330. }
  4331. };
  4332. /* script */
  4333. const __vue_script__$d = script$d;
  4334. /* template */
  4335. var __vue_render__$d = function() {
  4336. var _vm = this;
  4337. var _h = _vm.$createElement;
  4338. var _c = _vm._self._c || _h;
  4339. return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-12" }, [
  4340. _c(
  4341. "svg",
  4342. {
  4343. staticClass: "dv-border-svg-container",
  4344. attrs: { width: _vm.width, height: _vm.height }
  4345. },
  4346. [
  4347. _c("defs", [
  4348. _c(
  4349. "filter",
  4350. {
  4351. attrs: {
  4352. id: _vm.filterId,
  4353. height: "150%",
  4354. width: "150%",
  4355. x: "-25%",
  4356. y: "-25%"
  4357. }
  4358. },
  4359. [
  4360. _c("feMorphology", {
  4361. attrs: {
  4362. operator: "dilate",
  4363. radius: "1",
  4364. in: "SourceAlpha",
  4365. result: "thicken"
  4366. }
  4367. }),
  4368. _vm._v(" "),
  4369. _c("feGaussianBlur", {
  4370. attrs: { in: "thicken", stdDeviation: "2", result: "blurred" }
  4371. }),
  4372. _vm._v(" "),
  4373. _c(
  4374. "feFlood",
  4375. {
  4376. attrs: {
  4377. "flood-color": _vm.fade(
  4378. _vm.mergedColor[1] || _vm.defaultColor[1],
  4379. 70
  4380. ),
  4381. result: "glowColor"
  4382. }
  4383. },
  4384. [
  4385. _c("animate", {
  4386. attrs: {
  4387. attributeName: "flood-color",
  4388. values:
  4389. "\n " +
  4390. _vm.fade(
  4391. _vm.mergedColor[1] || _vm.defaultColor[1],
  4392. 70
  4393. ) +
  4394. ";\n " +
  4395. _vm.fade(
  4396. _vm.mergedColor[1] || _vm.defaultColor[1],
  4397. 30
  4398. ) +
  4399. ";\n " +
  4400. _vm.fade(
  4401. _vm.mergedColor[1] || _vm.defaultColor[1],
  4402. 70
  4403. ) +
  4404. ";\n ",
  4405. dur: "3s",
  4406. begin: "0s",
  4407. repeatCount: "indefinite"
  4408. }
  4409. })
  4410. ]
  4411. ),
  4412. _vm._v(" "),
  4413. _c("feComposite", {
  4414. attrs: {
  4415. in: "glowColor",
  4416. in2: "blurred",
  4417. operator: "in",
  4418. result: "softGlowColored"
  4419. }
  4420. }),
  4421. _vm._v(" "),
  4422. _c(
  4423. "feMerge",
  4424. [
  4425. _c("feMergeNode", { attrs: { in: "softGlowColored" } }),
  4426. _vm._v(" "),
  4427. _c("feMergeNode", { attrs: { in: "SourceGraphic" } })
  4428. ],
  4429. 1
  4430. )
  4431. ],
  4432. 1
  4433. )
  4434. ]),
  4435. _vm._v(" "),
  4436. _vm.width && _vm.height
  4437. ? _c("path", {
  4438. attrs: {
  4439. fill: _vm.backgroundColor,
  4440. "stroke-width": "2",
  4441. stroke: _vm.mergedColor[0],
  4442. d:
  4443. "\n M15 5 L " +
  4444. (_vm.width - 15) +
  4445. " 5 Q " +
  4446. (_vm.width - 5) +
  4447. " 5, " +
  4448. (_vm.width - 5) +
  4449. " 15\n L " +
  4450. (_vm.width - 5) +
  4451. " " +
  4452. (_vm.height - 15) +
  4453. " Q " +
  4454. (_vm.width - 5) +
  4455. " " +
  4456. (_vm.height - 5) +
  4457. ", " +
  4458. (_vm.width - 15) +
  4459. " " +
  4460. (_vm.height - 5) +
  4461. "\n L 15, " +
  4462. (_vm.height - 5) +
  4463. " Q 5 " +
  4464. (_vm.height - 5) +
  4465. " 5 " +
  4466. (_vm.height - 15) +
  4467. " L 5 15\n Q 5 5 15 5\n "
  4468. }
  4469. })
  4470. : _vm._e(),
  4471. _vm._v(" "),
  4472. _c("path", {
  4473. attrs: {
  4474. "stroke-width": "2",
  4475. fill: "transparent",
  4476. "stroke-linecap": "round",
  4477. filter: "url(#" + _vm.filterId + ")",
  4478. stroke: _vm.mergedColor[1],
  4479. d: "M 20 5 L 15 5 Q 5 5 5 15 L 5 20"
  4480. }
  4481. }),
  4482. _vm._v(" "),
  4483. _c("path", {
  4484. attrs: {
  4485. "stroke-width": "2",
  4486. fill: "transparent",
  4487. "stroke-linecap": "round",
  4488. filter: "url(#" + _vm.filterId + ")",
  4489. stroke: _vm.mergedColor[1],
  4490. d:
  4491. "M " +
  4492. (_vm.width - 20) +
  4493. " 5 L " +
  4494. (_vm.width - 15) +
  4495. " 5 Q " +
  4496. (_vm.width - 5) +
  4497. " 5 " +
  4498. (_vm.width - 5) +
  4499. " 15 L " +
  4500. (_vm.width - 5) +
  4501. " 20"
  4502. }
  4503. }),
  4504. _vm._v(" "),
  4505. _c("path", {
  4506. attrs: {
  4507. "stroke-width": "2",
  4508. fill: "transparent",
  4509. "stroke-linecap": "round",
  4510. filter: "url(#" + _vm.filterId + ")",
  4511. stroke: _vm.mergedColor[1],
  4512. d:
  4513. "\n M " +
  4514. (_vm.width - 20) +
  4515. " " +
  4516. (_vm.height - 5) +
  4517. " L " +
  4518. (_vm.width - 15) +
  4519. " " +
  4520. (_vm.height - 5) +
  4521. "\n Q " +
  4522. (_vm.width - 5) +
  4523. " " +
  4524. (_vm.height - 5) +
  4525. " " +
  4526. (_vm.width - 5) +
  4527. " " +
  4528. (_vm.height - 15) +
  4529. "\n L " +
  4530. (_vm.width - 5) +
  4531. " " +
  4532. (_vm.height - 20) +
  4533. "\n "
  4534. }
  4535. }),
  4536. _vm._v(" "),
  4537. _c("path", {
  4538. attrs: {
  4539. "stroke-width": "2",
  4540. fill: "transparent",
  4541. "stroke-linecap": "round",
  4542. filter: "url(#" + _vm.filterId + ")",
  4543. stroke: _vm.mergedColor[1],
  4544. d:
  4545. "\n M 20 " +
  4546. (_vm.height - 5) +
  4547. " L 15 " +
  4548. (_vm.height - 5) +
  4549. "\n Q 5 " +
  4550. (_vm.height - 5) +
  4551. " 5 " +
  4552. (_vm.height - 15) +
  4553. "\n L 5 " +
  4554. (_vm.height - 20) +
  4555. "\n "
  4556. }
  4557. })
  4558. ]
  4559. ),
  4560. _vm._v(" "),
  4561. _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
  4562. ])
  4563. };
  4564. var __vue_staticRenderFns__$d = [];
  4565. __vue_render__$d._withStripped = true;
  4566. /* style */
  4567. const __vue_inject_styles__$d = function (inject) {
  4568. if (!inject) return
  4569. inject("data-v-40c58fd4_0", { source: ".dv-border-box-12 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-12 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-12 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-12 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-12 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-12 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  4570. };
  4571. /* scoped */
  4572. const __vue_scope_id__$d = undefined;
  4573. /* module identifier */
  4574. const __vue_module_identifier__$d = undefined;
  4575. /* functional template */
  4576. const __vue_is_functional_template__$d = false;
  4577. /* style inject SSR */
  4578. /* style inject shadow dom */
  4579. const __vue_component__$d = /*#__PURE__*/normalizeComponent(
  4580. { render: __vue_render__$d, staticRenderFns: __vue_staticRenderFns__$d },
  4581. __vue_inject_styles__$d,
  4582. __vue_script__$d,
  4583. __vue_scope_id__$d,
  4584. __vue_is_functional_template__$d,
  4585. __vue_module_identifier__$d,
  4586. false,
  4587. createInjector,
  4588. undefined,
  4589. undefined
  4590. );
  4591. function borderBox12 (Vue) {
  4592. Vue.component(__vue_component__$d.name, __vue_component__$d);
  4593. }
  4594. //
  4595. var script$e = {
  4596. name: 'DvBorderBox13',
  4597. mixins: [autoResize],
  4598. props: {
  4599. color: {
  4600. type: Array,
  4601. default: () => []
  4602. },
  4603. backgroundColor: {
  4604. type: String,
  4605. default: 'transparent'
  4606. }
  4607. },
  4608. data() {
  4609. return {
  4610. ref: 'border-box-13',
  4611. defaultColor: ['#6586ec', '#2cf7fe'],
  4612. mergedColor: []
  4613. };
  4614. },
  4615. watch: {
  4616. color() {
  4617. const {
  4618. mergeColor
  4619. } = this;
  4620. mergeColor();
  4621. }
  4622. },
  4623. methods: {
  4624. mergeColor() {
  4625. const {
  4626. color,
  4627. defaultColor
  4628. } = this;
  4629. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  4630. }
  4631. },
  4632. mounted() {
  4633. const {
  4634. mergeColor
  4635. } = this;
  4636. mergeColor();
  4637. }
  4638. };
  4639. /* script */
  4640. const __vue_script__$e = script$e;
  4641. /* template */
  4642. var __vue_render__$e = function() {
  4643. var _vm = this;
  4644. var _h = _vm.$createElement;
  4645. var _c = _vm._self._c || _h;
  4646. return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-13" }, [
  4647. _c(
  4648. "svg",
  4649. {
  4650. staticClass: "dv-border-svg-container",
  4651. attrs: { width: _vm.width, height: _vm.height }
  4652. },
  4653. [
  4654. _c("path", {
  4655. attrs: {
  4656. fill: _vm.backgroundColor,
  4657. stroke: _vm.mergedColor[0],
  4658. d:
  4659. "\n M 5 20 L 5 10 L 12 3 L 60 3 L 68 10\n L " +
  4660. (_vm.width - 20) +
  4661. " 10 L " +
  4662. (_vm.width - 5) +
  4663. " 25\n L " +
  4664. (_vm.width - 5) +
  4665. " " +
  4666. (_vm.height - 5) +
  4667. " L 20 " +
  4668. (_vm.height - 5) +
  4669. "\n L 5 " +
  4670. (_vm.height - 20) +
  4671. " L 5 20\n "
  4672. }
  4673. }),
  4674. _vm._v(" "),
  4675. _c("path", {
  4676. attrs: {
  4677. fill: "transparent",
  4678. "stroke-width": "3",
  4679. "stroke-linecap": "round",
  4680. "stroke-dasharray": "10, 5",
  4681. stroke: _vm.mergedColor[0],
  4682. d: "M 16 9 L 61 9"
  4683. }
  4684. }),
  4685. _vm._v(" "),
  4686. _c("path", {
  4687. attrs: {
  4688. fill: "transparent",
  4689. stroke: _vm.mergedColor[1],
  4690. d: "M 5 20 L 5 10 L 12 3 L 60 3 L 68 10"
  4691. }
  4692. }),
  4693. _vm._v(" "),
  4694. _c("path", {
  4695. attrs: {
  4696. fill: "transparent",
  4697. stroke: _vm.mergedColor[1],
  4698. d:
  4699. "M " +
  4700. (_vm.width - 5) +
  4701. " " +
  4702. (_vm.height - 30) +
  4703. " L " +
  4704. (_vm.width - 5) +
  4705. " " +
  4706. (_vm.height - 5) +
  4707. " L " +
  4708. (_vm.width - 30) +
  4709. " " +
  4710. (_vm.height - 5)
  4711. }
  4712. })
  4713. ]
  4714. ),
  4715. _vm._v(" "),
  4716. _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
  4717. ])
  4718. };
  4719. var __vue_staticRenderFns__$e = [];
  4720. __vue_render__$e._withStripped = true;
  4721. /* style */
  4722. const __vue_inject_styles__$e = function (inject) {
  4723. if (!inject) return
  4724. inject("data-v-6c30a53b_0", { source: ".dv-border-box-13 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-13 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-13 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-border-box-13 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-border-box-13 .dv-border-svg-container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-border-box-13 .border-box-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  4725. };
  4726. /* scoped */
  4727. const __vue_scope_id__$e = undefined;
  4728. /* module identifier */
  4729. const __vue_module_identifier__$e = undefined;
  4730. /* functional template */
  4731. const __vue_is_functional_template__$e = false;
  4732. /* style inject SSR */
  4733. /* style inject shadow dom */
  4734. const __vue_component__$e = /*#__PURE__*/normalizeComponent(
  4735. { render: __vue_render__$e, staticRenderFns: __vue_staticRenderFns__$e },
  4736. __vue_inject_styles__$e,
  4737. __vue_script__$e,
  4738. __vue_scope_id__$e,
  4739. __vue_is_functional_template__$e,
  4740. __vue_module_identifier__$e,
  4741. false,
  4742. createInjector,
  4743. undefined,
  4744. undefined
  4745. );
  4746. function borderBox13 (Vue) {
  4747. Vue.component(__vue_component__$e.name, __vue_component__$e);
  4748. }
  4749. //
  4750. var script$f = {
  4751. name: 'DvDecoration1',
  4752. mixins: [autoResize],
  4753. props: {
  4754. color: {
  4755. type: Array,
  4756. default: () => []
  4757. }
  4758. },
  4759. data() {
  4760. const pointSideLength = 2.5;
  4761. return {
  4762. ref: 'decoration-1',
  4763. svgWH: [200, 50],
  4764. svgScale: [1, 1],
  4765. rowNum: 4,
  4766. rowPoints: 20,
  4767. pointSideLength,
  4768. halfPointSideLength: pointSideLength / 2,
  4769. points: [],
  4770. rects: [],
  4771. defaultColor: ['#fff', '#0de7c2'],
  4772. mergedColor: []
  4773. };
  4774. },
  4775. watch: {
  4776. color() {
  4777. const {
  4778. mergeColor
  4779. } = this;
  4780. mergeColor();
  4781. }
  4782. },
  4783. methods: {
  4784. afterAutoResizeMixinInit() {
  4785. const {
  4786. calcSVGData
  4787. } = this;
  4788. calcSVGData();
  4789. },
  4790. calcSVGData() {
  4791. const {
  4792. calcPointsPosition,
  4793. calcRectsPosition,
  4794. calcScale
  4795. } = this;
  4796. calcPointsPosition();
  4797. calcRectsPosition();
  4798. calcScale();
  4799. },
  4800. calcPointsPosition() {
  4801. const {
  4802. svgWH,
  4803. rowNum,
  4804. rowPoints
  4805. } = this;
  4806. const [w, h] = svgWH;
  4807. const horizontalGap = w / (rowPoints + 1);
  4808. const verticalGap = h / (rowNum + 1);
  4809. let points = new Array(rowNum).fill(0).map((foo, i) => new Array(rowPoints).fill(0).map((foo, j) => [horizontalGap * (j + 1), verticalGap * (i + 1)]));
  4810. this.points = points.reduce((all, item) => [...all, ...item], []);
  4811. },
  4812. calcRectsPosition() {
  4813. const {
  4814. points,
  4815. rowPoints
  4816. } = this;
  4817. const rect1 = points[rowPoints * 2 - 1];
  4818. const rect2 = points[rowPoints * 2 - 3];
  4819. this.rects = [rect1, rect2];
  4820. },
  4821. calcScale() {
  4822. const {
  4823. width,
  4824. height,
  4825. svgWH
  4826. } = this;
  4827. const [w, h] = svgWH;
  4828. this.svgScale = [width / w, height / h];
  4829. },
  4830. onResize() {
  4831. const {
  4832. calcSVGData
  4833. } = this;
  4834. calcSVGData();
  4835. },
  4836. mergeColor() {
  4837. const {
  4838. color,
  4839. defaultColor
  4840. } = this;
  4841. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  4842. }
  4843. },
  4844. mounted() {
  4845. const {
  4846. mergeColor
  4847. } = this;
  4848. mergeColor();
  4849. }
  4850. };
  4851. /* script */
  4852. const __vue_script__$f = script$f;
  4853. /* template */
  4854. var __vue_render__$f = function() {
  4855. var _vm = this;
  4856. var _h = _vm.$createElement;
  4857. var _c = _vm._self._c || _h;
  4858. return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-1" }, [
  4859. _c(
  4860. "svg",
  4861. {
  4862. style:
  4863. "transform:scale(" + _vm.svgScale[0] + "," + _vm.svgScale[1] + ");",
  4864. attrs: { width: _vm.svgWH[0] + "px", height: _vm.svgWH[1] + "px" }
  4865. },
  4866. [
  4867. _vm._l(_vm.points, function(point, i) {
  4868. return [
  4869. Math.random() > 0.6
  4870. ? _c(
  4871. "rect",
  4872. {
  4873. key: i,
  4874. attrs: {
  4875. fill: _vm.mergedColor[0],
  4876. x: point[0] - _vm.halfPointSideLength,
  4877. y: point[1] - _vm.halfPointSideLength,
  4878. width: _vm.pointSideLength,
  4879. height: _vm.pointSideLength
  4880. }
  4881. },
  4882. [
  4883. Math.random() > 0.6
  4884. ? _c("animate", {
  4885. attrs: {
  4886. attributeName: "fill",
  4887. values: _vm.mergedColor[0] + ";transparent",
  4888. dur: "1s",
  4889. begin: Math.random() * 2,
  4890. repeatCount: "indefinite"
  4891. }
  4892. })
  4893. : _vm._e()
  4894. ]
  4895. )
  4896. : _vm._e()
  4897. ]
  4898. }),
  4899. _vm._v(" "),
  4900. _vm.rects[0]
  4901. ? _c(
  4902. "rect",
  4903. {
  4904. attrs: {
  4905. fill: _vm.mergedColor[1],
  4906. x: _vm.rects[0][0] - _vm.pointSideLength,
  4907. y: _vm.rects[0][1] - _vm.pointSideLength,
  4908. width: _vm.pointSideLength * 2,
  4909. height: _vm.pointSideLength * 2
  4910. }
  4911. },
  4912. [
  4913. _c("animate", {
  4914. attrs: {
  4915. attributeName: "width",
  4916. values: "0;" + _vm.pointSideLength * 2,
  4917. dur: "2s",
  4918. repeatCount: "indefinite"
  4919. }
  4920. }),
  4921. _vm._v(" "),
  4922. _c("animate", {
  4923. attrs: {
  4924. attributeName: "height",
  4925. values: "0;" + _vm.pointSideLength * 2,
  4926. dur: "2s",
  4927. repeatCount: "indefinite"
  4928. }
  4929. }),
  4930. _vm._v(" "),
  4931. _c("animate", {
  4932. attrs: {
  4933. attributeName: "x",
  4934. values:
  4935. _vm.rects[0][0] +
  4936. ";" +
  4937. (_vm.rects[0][0] - _vm.pointSideLength),
  4938. dur: "2s",
  4939. repeatCount: "indefinite"
  4940. }
  4941. }),
  4942. _vm._v(" "),
  4943. _c("animate", {
  4944. attrs: {
  4945. attributeName: "y",
  4946. values:
  4947. _vm.rects[0][1] +
  4948. ";" +
  4949. (_vm.rects[0][1] - _vm.pointSideLength),
  4950. dur: "2s",
  4951. repeatCount: "indefinite"
  4952. }
  4953. })
  4954. ]
  4955. )
  4956. : _vm._e(),
  4957. _vm._v(" "),
  4958. _vm.rects[1]
  4959. ? _c(
  4960. "rect",
  4961. {
  4962. attrs: {
  4963. fill: _vm.mergedColor[1],
  4964. x: _vm.rects[1][0] - 40,
  4965. y: _vm.rects[1][1] - _vm.pointSideLength,
  4966. width: 40,
  4967. height: _vm.pointSideLength * 2
  4968. }
  4969. },
  4970. [
  4971. _c("animate", {
  4972. attrs: {
  4973. attributeName: "width",
  4974. values: "0;40;0",
  4975. dur: "2s",
  4976. repeatCount: "indefinite"
  4977. }
  4978. }),
  4979. _vm._v(" "),
  4980. _c("animate", {
  4981. attrs: {
  4982. attributeName: "x",
  4983. values:
  4984. _vm.rects[1][0] +
  4985. ";" +
  4986. (_vm.rects[1][0] - 40) +
  4987. ";" +
  4988. _vm.rects[1][0],
  4989. dur: "2s",
  4990. repeatCount: "indefinite"
  4991. }
  4992. })
  4993. ]
  4994. )
  4995. : _vm._e()
  4996. ],
  4997. 2
  4998. )
  4999. ])
  5000. };
  5001. var __vue_staticRenderFns__$f = [];
  5002. __vue_render__$f._withStripped = true;
  5003. /* style */
  5004. const __vue_inject_styles__$f = function (inject) {
  5005. if (!inject) return
  5006. inject("data-v-69241e60_0", { source: ".dv-decoration-1 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-1 svg {\n transform-origin: left top;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,0BAA0B;AAC5B","file":"main.vue","sourcesContent":[".dv-decoration-1 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-1 svg {\n transform-origin: left top;\n}\n"]}, media: undefined });
  5007. };
  5008. /* scoped */
  5009. const __vue_scope_id__$f = undefined;
  5010. /* module identifier */
  5011. const __vue_module_identifier__$f = undefined;
  5012. /* functional template */
  5013. const __vue_is_functional_template__$f = false;
  5014. /* style inject SSR */
  5015. /* style inject shadow dom */
  5016. const __vue_component__$f = /*#__PURE__*/normalizeComponent(
  5017. { render: __vue_render__$f, staticRenderFns: __vue_staticRenderFns__$f },
  5018. __vue_inject_styles__$f,
  5019. __vue_script__$f,
  5020. __vue_scope_id__$f,
  5021. __vue_is_functional_template__$f,
  5022. __vue_module_identifier__$f,
  5023. false,
  5024. createInjector,
  5025. undefined,
  5026. undefined
  5027. );
  5028. function decoration1 (Vue) {
  5029. Vue.component(__vue_component__$f.name, __vue_component__$f);
  5030. }
  5031. //
  5032. var script$g = {
  5033. name: 'DvDecoration2',
  5034. mixins: [autoResize],
  5035. props: {
  5036. color: {
  5037. type: Array,
  5038. default: () => []
  5039. },
  5040. reverse: {
  5041. type: Boolean,
  5042. default: false
  5043. },
  5044. dur: {
  5045. type: Number,
  5046. default: 6
  5047. }
  5048. },
  5049. data() {
  5050. return {
  5051. ref: 'decoration-2',
  5052. x: 0,
  5053. y: 0,
  5054. w: 0,
  5055. h: 0,
  5056. defaultColor: ['#3faacb', '#fff'],
  5057. mergedColor: []
  5058. };
  5059. },
  5060. watch: {
  5061. color() {
  5062. const {
  5063. mergeColor
  5064. } = this;
  5065. mergeColor();
  5066. },
  5067. reverse() {
  5068. const {
  5069. calcSVGData
  5070. } = this;
  5071. calcSVGData();
  5072. }
  5073. },
  5074. methods: {
  5075. afterAutoResizeMixinInit() {
  5076. const {
  5077. calcSVGData
  5078. } = this;
  5079. calcSVGData();
  5080. },
  5081. calcSVGData() {
  5082. const {
  5083. reverse,
  5084. width,
  5085. height
  5086. } = this;
  5087. if (reverse) {
  5088. this.w = 1;
  5089. this.h = height;
  5090. this.x = width / 2;
  5091. this.y = 0;
  5092. } else {
  5093. this.w = width;
  5094. this.h = 1;
  5095. this.x = 0;
  5096. this.y = height / 2;
  5097. }
  5098. },
  5099. onResize() {
  5100. const {
  5101. calcSVGData
  5102. } = this;
  5103. calcSVGData();
  5104. },
  5105. mergeColor() {
  5106. const {
  5107. color,
  5108. defaultColor
  5109. } = this;
  5110. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  5111. }
  5112. },
  5113. mounted() {
  5114. const {
  5115. mergeColor
  5116. } = this;
  5117. mergeColor();
  5118. }
  5119. };
  5120. /* script */
  5121. const __vue_script__$g = script$g;
  5122. /* template */
  5123. var __vue_render__$g = function() {
  5124. var _vm = this;
  5125. var _h = _vm.$createElement;
  5126. var _c = _vm._self._c || _h;
  5127. return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-2" }, [
  5128. _c(
  5129. "svg",
  5130. { attrs: { width: _vm.width + "px", height: _vm.height + "px" } },
  5131. [
  5132. _c(
  5133. "rect",
  5134. {
  5135. attrs: {
  5136. x: _vm.x,
  5137. y: _vm.y,
  5138. width: _vm.w,
  5139. height: _vm.h,
  5140. fill: _vm.mergedColor[0]
  5141. }
  5142. },
  5143. [
  5144. _c("animate", {
  5145. attrs: {
  5146. attributeName: _vm.reverse ? "height" : "width",
  5147. from: "0",
  5148. to: _vm.reverse ? _vm.height : _vm.width,
  5149. dur: _vm.dur + "s",
  5150. calcMode: "spline",
  5151. keyTimes: "0;1",
  5152. keySplines: ".42,0,.58,1",
  5153. repeatCount: "indefinite"
  5154. }
  5155. })
  5156. ]
  5157. ),
  5158. _vm._v(" "),
  5159. _c(
  5160. "rect",
  5161. {
  5162. attrs: {
  5163. x: _vm.x,
  5164. y: _vm.y,
  5165. width: "1",
  5166. height: "1",
  5167. fill: _vm.mergedColor[1]
  5168. }
  5169. },
  5170. [
  5171. _c("animate", {
  5172. attrs: {
  5173. attributeName: _vm.reverse ? "y" : "x",
  5174. from: "0",
  5175. to: _vm.reverse ? _vm.height : _vm.width,
  5176. dur: _vm.dur + "s",
  5177. calcMode: "spline",
  5178. keyTimes: "0;1",
  5179. keySplines: "0.42,0,0.58,1",
  5180. repeatCount: "indefinite"
  5181. }
  5182. })
  5183. ]
  5184. )
  5185. ]
  5186. )
  5187. ])
  5188. };
  5189. var __vue_staticRenderFns__$g = [];
  5190. __vue_render__$g._withStripped = true;
  5191. /* style */
  5192. const __vue_inject_styles__$g = function (inject) {
  5193. if (!inject) return
  5194. inject("data-v-355e4674_0", { source: ".dv-decoration-2 {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,WAAW;EACX,YAAY;EACZ,uBAAuB;EACvB,mBAAmB;AACrB","file":"main.vue","sourcesContent":[".dv-decoration-2 {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n}\n"]}, media: undefined });
  5195. };
  5196. /* scoped */
  5197. const __vue_scope_id__$g = undefined;
  5198. /* module identifier */
  5199. const __vue_module_identifier__$g = undefined;
  5200. /* functional template */
  5201. const __vue_is_functional_template__$g = false;
  5202. /* style inject SSR */
  5203. /* style inject shadow dom */
  5204. const __vue_component__$g = /*#__PURE__*/normalizeComponent(
  5205. { render: __vue_render__$g, staticRenderFns: __vue_staticRenderFns__$g },
  5206. __vue_inject_styles__$g,
  5207. __vue_script__$g,
  5208. __vue_scope_id__$g,
  5209. __vue_is_functional_template__$g,
  5210. __vue_module_identifier__$g,
  5211. false,
  5212. createInjector,
  5213. undefined,
  5214. undefined
  5215. );
  5216. function decoration2 (Vue) {
  5217. Vue.component(__vue_component__$g.name, __vue_component__$g);
  5218. }
  5219. //
  5220. var script$h = {
  5221. name: 'DvDecoration3',
  5222. mixins: [autoResize],
  5223. props: {
  5224. color: {
  5225. type: Array,
  5226. default: () => []
  5227. }
  5228. },
  5229. data() {
  5230. const pointSideLength = 7;
  5231. return {
  5232. ref: 'decoration-3',
  5233. svgWH: [300, 35],
  5234. svgScale: [1, 1],
  5235. rowNum: 2,
  5236. rowPoints: 25,
  5237. pointSideLength,
  5238. halfPointSideLength: pointSideLength / 2,
  5239. points: [],
  5240. defaultColor: ['#7acaec', 'transparent'],
  5241. mergedColor: []
  5242. };
  5243. },
  5244. watch: {
  5245. color() {
  5246. const {
  5247. mergeColor
  5248. } = this;
  5249. mergeColor();
  5250. }
  5251. },
  5252. methods: {
  5253. afterAutoResizeMixinInit() {
  5254. const {
  5255. calcSVGData
  5256. } = this;
  5257. calcSVGData();
  5258. },
  5259. calcSVGData() {
  5260. const {
  5261. calcPointsPosition,
  5262. calcScale
  5263. } = this;
  5264. calcPointsPosition();
  5265. calcScale();
  5266. },
  5267. calcPointsPosition() {
  5268. const {
  5269. svgWH,
  5270. rowNum,
  5271. rowPoints
  5272. } = this;
  5273. const [w, h] = svgWH;
  5274. const horizontalGap = w / (rowPoints + 1);
  5275. const verticalGap = h / (rowNum + 1);
  5276. let points = new Array(rowNum).fill(0).map((foo, i) => new Array(rowPoints).fill(0).map((foo, j) => [horizontalGap * (j + 1), verticalGap * (i + 1)]));
  5277. this.points = points.reduce((all, item) => [...all, ...item], []);
  5278. },
  5279. calcScale() {
  5280. const {
  5281. width,
  5282. height,
  5283. svgWH
  5284. } = this;
  5285. const [w, h] = svgWH;
  5286. this.svgScale = [width / w, height / h];
  5287. },
  5288. onResize() {
  5289. const {
  5290. calcSVGData
  5291. } = this;
  5292. calcSVGData();
  5293. },
  5294. mergeColor() {
  5295. const {
  5296. color,
  5297. defaultColor
  5298. } = this;
  5299. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  5300. }
  5301. },
  5302. mounted() {
  5303. const {
  5304. mergeColor
  5305. } = this;
  5306. mergeColor();
  5307. }
  5308. };
  5309. /* script */
  5310. const __vue_script__$h = script$h;
  5311. /* template */
  5312. var __vue_render__$h = function() {
  5313. var _vm = this;
  5314. var _h = _vm.$createElement;
  5315. var _c = _vm._self._c || _h;
  5316. return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-3" }, [
  5317. _c(
  5318. "svg",
  5319. {
  5320. style:
  5321. "transform:scale(" + _vm.svgScale[0] + "," + _vm.svgScale[1] + ");",
  5322. attrs: { width: _vm.svgWH[0] + "px", height: _vm.svgWH[1] + "px" }
  5323. },
  5324. [
  5325. _vm._l(_vm.points, function(point, i) {
  5326. return [
  5327. _c(
  5328. "rect",
  5329. {
  5330. key: i,
  5331. attrs: {
  5332. fill: _vm.mergedColor[0],
  5333. x: point[0] - _vm.halfPointSideLength,
  5334. y: point[1] - _vm.halfPointSideLength,
  5335. width: _vm.pointSideLength,
  5336. height: _vm.pointSideLength
  5337. }
  5338. },
  5339. [
  5340. Math.random() > 0.6
  5341. ? _c("animate", {
  5342. attrs: {
  5343. attributeName: "fill",
  5344. values: "" + _vm.mergedColor.join(";"),
  5345. dur: Math.random() + 1 + "s",
  5346. begin: Math.random() * 2,
  5347. repeatCount: "indefinite"
  5348. }
  5349. })
  5350. : _vm._e()
  5351. ]
  5352. )
  5353. ]
  5354. })
  5355. ],
  5356. 2
  5357. )
  5358. ])
  5359. };
  5360. var __vue_staticRenderFns__$h = [];
  5361. __vue_render__$h._withStripped = true;
  5362. /* style */
  5363. const __vue_inject_styles__$h = function (inject) {
  5364. if (!inject) return
  5365. inject("data-v-2cd3ac93_0", { source: ".dv-decoration-3 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-3 svg {\n transform-origin: left top;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,0BAA0B;AAC5B","file":"main.vue","sourcesContent":[".dv-decoration-3 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-3 svg {\n transform-origin: left top;\n}\n"]}, media: undefined });
  5366. };
  5367. /* scoped */
  5368. const __vue_scope_id__$h = undefined;
  5369. /* module identifier */
  5370. const __vue_module_identifier__$h = undefined;
  5371. /* functional template */
  5372. const __vue_is_functional_template__$h = false;
  5373. /* style inject SSR */
  5374. /* style inject shadow dom */
  5375. const __vue_component__$h = /*#__PURE__*/normalizeComponent(
  5376. { render: __vue_render__$h, staticRenderFns: __vue_staticRenderFns__$h },
  5377. __vue_inject_styles__$h,
  5378. __vue_script__$h,
  5379. __vue_scope_id__$h,
  5380. __vue_is_functional_template__$h,
  5381. __vue_module_identifier__$h,
  5382. false,
  5383. createInjector,
  5384. undefined,
  5385. undefined
  5386. );
  5387. function decoration3 (Vue) {
  5388. Vue.component(__vue_component__$h.name, __vue_component__$h);
  5389. }
  5390. //
  5391. var script$i = {
  5392. name: 'DvDecoration4',
  5393. mixins: [autoResize],
  5394. props: {
  5395. color: {
  5396. type: Array,
  5397. default: () => []
  5398. },
  5399. reverse: {
  5400. type: Boolean,
  5401. default: false
  5402. },
  5403. dur: {
  5404. type: Number,
  5405. default: 3
  5406. }
  5407. },
  5408. data() {
  5409. return {
  5410. ref: 'decoration-4',
  5411. defaultColor: ['rgba(255, 255, 255, 0.3)', 'rgba(255, 255, 255, 0.3)'],
  5412. mergedColor: []
  5413. };
  5414. },
  5415. watch: {
  5416. color() {
  5417. const {
  5418. mergeColor
  5419. } = this;
  5420. mergeColor();
  5421. }
  5422. },
  5423. methods: {
  5424. mergeColor() {
  5425. const {
  5426. color,
  5427. defaultColor
  5428. } = this;
  5429. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  5430. }
  5431. },
  5432. mounted() {
  5433. const {
  5434. mergeColor
  5435. } = this;
  5436. mergeColor();
  5437. }
  5438. };
  5439. /* script */
  5440. const __vue_script__$i = script$i;
  5441. /* template */
  5442. var __vue_render__$i = function() {
  5443. var _vm = this;
  5444. var _h = _vm.$createElement;
  5445. var _c = _vm._self._c || _h;
  5446. return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-4" }, [
  5447. _c(
  5448. "div",
  5449. {
  5450. class: "container " + (_vm.reverse ? "reverse" : "normal"),
  5451. style: _vm.reverse
  5452. ? "width:" +
  5453. _vm.width +
  5454. "px;height:5px;animation-duration:" +
  5455. _vm.dur +
  5456. "s"
  5457. : "width:5px;height:" +
  5458. _vm.height +
  5459. "px;animation-duration:" +
  5460. _vm.dur +
  5461. "s"
  5462. },
  5463. [
  5464. _c(
  5465. "svg",
  5466. {
  5467. attrs: {
  5468. width: _vm.reverse ? _vm.width : 5,
  5469. height: _vm.reverse ? 5 : _vm.height
  5470. }
  5471. },
  5472. [
  5473. _c("polyline", {
  5474. attrs: {
  5475. stroke: _vm.mergedColor[0],
  5476. points: _vm.reverse
  5477. ? "0, 2.5 " + _vm.width + ", 2.5"
  5478. : "2.5, 0 2.5, " + _vm.height
  5479. }
  5480. }),
  5481. _vm._v(" "),
  5482. _c("polyline", {
  5483. staticClass: "bold-line",
  5484. attrs: {
  5485. stroke: _vm.mergedColor[1],
  5486. "stroke-width": "3",
  5487. "stroke-dasharray": "20, 80",
  5488. "stroke-dashoffset": "-30",
  5489. points: _vm.reverse
  5490. ? "0, 2.5 " + _vm.width + ", 2.5"
  5491. : "2.5, 0 2.5, " + _vm.height
  5492. }
  5493. })
  5494. ]
  5495. )
  5496. ]
  5497. )
  5498. ])
  5499. };
  5500. var __vue_staticRenderFns__$i = [];
  5501. __vue_render__$i._withStripped = true;
  5502. /* style */
  5503. const __vue_inject_styles__$i = function (inject) {
  5504. if (!inject) return
  5505. inject("data-v-506ac984_0", { source: ".dv-decoration-4 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-decoration-4 .container {\n display: flex;\n overflow: hidden;\n position: absolute;\n flex: 1;\n}\n.dv-decoration-4 .normal {\n animation: ani-height ease-in-out infinite;\n left: 50%;\n margin-left: -2px;\n}\n.dv-decoration-4 .reverse {\n animation: ani-width ease-in-out infinite;\n top: 50%;\n margin-top: -2px;\n}\n@keyframes ani-height {\n0% {\n height: 0%;\n}\n70% {\n height: 100%;\n}\n100% {\n height: 100%;\n}\n}\n@keyframes ani-width {\n0% {\n width: 0%;\n}\n70% {\n width: 100%;\n}\n100% {\n width: 100%;\n}\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,aAAa;EACb,gBAAgB;EAChB,kBAAkB;EAClB,OAAO;AACT;AACA;EACE,0CAA0C;EAC1C,SAAS;EACT,iBAAiB;AACnB;AACA;EACE,yCAAyC;EACzC,QAAQ;EACR,gBAAgB;AAClB;AACA;AACE;IACE,UAAU;AACZ;AACA;IACE,YAAY;AACd;AACA;IACE,YAAY;AACd;AACF;AACA;AACE;IACE,SAAS;AACX;AACA;IACE,WAAW;AACb;AACA;IACE,WAAW;AACb;AACF","file":"main.vue","sourcesContent":[".dv-decoration-4 {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-decoration-4 .container {\n display: flex;\n overflow: hidden;\n position: absolute;\n flex: 1;\n}\n.dv-decoration-4 .normal {\n animation: ani-height ease-in-out infinite;\n left: 50%;\n margin-left: -2px;\n}\n.dv-decoration-4 .reverse {\n animation: ani-width ease-in-out infinite;\n top: 50%;\n margin-top: -2px;\n}\n@keyframes ani-height {\n 0% {\n height: 0%;\n }\n 70% {\n height: 100%;\n }\n 100% {\n height: 100%;\n }\n}\n@keyframes ani-width {\n 0% {\n width: 0%;\n }\n 70% {\n width: 100%;\n }\n 100% {\n width: 100%;\n }\n}\n"]}, media: undefined });
  5506. };
  5507. /* scoped */
  5508. const __vue_scope_id__$i = undefined;
  5509. /* module identifier */
  5510. const __vue_module_identifier__$i = undefined;
  5511. /* functional template */
  5512. const __vue_is_functional_template__$i = false;
  5513. /* style inject SSR */
  5514. /* style inject shadow dom */
  5515. const __vue_component__$i = /*#__PURE__*/normalizeComponent(
  5516. { render: __vue_render__$i, staticRenderFns: __vue_staticRenderFns__$i },
  5517. __vue_inject_styles__$i,
  5518. __vue_script__$i,
  5519. __vue_scope_id__$i,
  5520. __vue_is_functional_template__$i,
  5521. __vue_module_identifier__$i,
  5522. false,
  5523. createInjector,
  5524. undefined,
  5525. undefined
  5526. );
  5527. function decoration4 (Vue) {
  5528. Vue.component(__vue_component__$i.name, __vue_component__$i);
  5529. }
  5530. //
  5531. var script$j = {
  5532. name: 'DvDecoration5',
  5533. mixins: [autoResize],
  5534. props: {
  5535. color: {
  5536. type: Array,
  5537. default: () => []
  5538. },
  5539. dur: {
  5540. type: Number,
  5541. default: 1.2
  5542. }
  5543. },
  5544. data() {
  5545. return {
  5546. ref: 'decoration-5',
  5547. line1Points: '',
  5548. line2Points: '',
  5549. line1Length: 0,
  5550. line2Length: 0,
  5551. defaultColor: ['#3f96a5', '#3f96a5'],
  5552. mergedColor: []
  5553. };
  5554. },
  5555. watch: {
  5556. color() {
  5557. const {
  5558. mergeColor
  5559. } = this;
  5560. mergeColor();
  5561. }
  5562. },
  5563. methods: {
  5564. afterAutoResizeMixinInit() {
  5565. const {
  5566. calcSVGData
  5567. } = this;
  5568. calcSVGData();
  5569. },
  5570. calcSVGData() {
  5571. const {
  5572. width,
  5573. height
  5574. } = this;
  5575. let line1Points = [[0, height * 0.2], [width * 0.18, height * 0.2], [width * 0.2, height * 0.4], [width * 0.25, height * 0.4], [width * 0.27, height * 0.6], [width * 0.72, height * 0.6], [width * 0.75, height * 0.4], [width * 0.8, height * 0.4], [width * 0.82, height * 0.2], [width, height * 0.2]];
  5576. let line2Points = [[width * 0.3, height * 0.8], [width * 0.7, height * 0.8]];
  5577. const line1Length = util_7$1(line1Points);
  5578. const line2Length = util_7$1(line2Points);
  5579. line1Points = line1Points.map(point => point.join(',')).join(' ');
  5580. line2Points = line2Points.map(point => point.join(',')).join(' ');
  5581. this.line1Points = line1Points;
  5582. this.line2Points = line2Points;
  5583. this.line1Length = line1Length;
  5584. this.line2Length = line2Length;
  5585. },
  5586. onResize() {
  5587. const {
  5588. calcSVGData
  5589. } = this;
  5590. calcSVGData();
  5591. },
  5592. mergeColor() {
  5593. const {
  5594. color,
  5595. defaultColor
  5596. } = this;
  5597. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  5598. }
  5599. },
  5600. mounted() {
  5601. const {
  5602. mergeColor
  5603. } = this;
  5604. mergeColor();
  5605. }
  5606. };
  5607. /* script */
  5608. const __vue_script__$j = script$j;
  5609. /* template */
  5610. var __vue_render__$j = function() {
  5611. var _vm = this;
  5612. var _h = _vm.$createElement;
  5613. var _c = _vm._self._c || _h;
  5614. return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-5" }, [
  5615. _c("svg", { attrs: { width: _vm.width, height: _vm.height } }, [
  5616. _c(
  5617. "polyline",
  5618. {
  5619. attrs: {
  5620. fill: "transparent",
  5621. stroke: _vm.mergedColor[0],
  5622. "stroke-width": "3",
  5623. points: _vm.line1Points
  5624. }
  5625. },
  5626. [
  5627. _c("animate", {
  5628. attrs: {
  5629. attributeName: "stroke-dasharray",
  5630. attributeType: "XML",
  5631. from: "0, " + _vm.line1Length / 2 + ", 0, " + _vm.line1Length / 2,
  5632. to: "0, 0, " + _vm.line1Length + ", 0",
  5633. dur: _vm.dur + "s",
  5634. begin: "0s",
  5635. calcMode: "spline",
  5636. keyTimes: "0;1",
  5637. keySplines: "0.4,1,0.49,0.98",
  5638. repeatCount: "indefinite"
  5639. }
  5640. })
  5641. ]
  5642. ),
  5643. _vm._v(" "),
  5644. _c(
  5645. "polyline",
  5646. {
  5647. attrs: {
  5648. fill: "transparent",
  5649. stroke: _vm.mergedColor[1],
  5650. "stroke-width": "2",
  5651. points: _vm.line2Points
  5652. }
  5653. },
  5654. [
  5655. _c("animate", {
  5656. attrs: {
  5657. attributeName: "stroke-dasharray",
  5658. attributeType: "XML",
  5659. from: "0, " + _vm.line2Length / 2 + ", 0, " + _vm.line2Length / 2,
  5660. to: "0, 0, " + _vm.line2Length + ", 0",
  5661. dur: _vm.dur + "s",
  5662. begin: "0s",
  5663. calcMode: "spline",
  5664. keyTimes: "0;1",
  5665. keySplines: ".4,1,.49,.98",
  5666. repeatCount: "indefinite"
  5667. }
  5668. })
  5669. ]
  5670. )
  5671. ])
  5672. ])
  5673. };
  5674. var __vue_staticRenderFns__$j = [];
  5675. __vue_render__$j._withStripped = true;
  5676. /* style */
  5677. const __vue_inject_styles__$j = function (inject) {
  5678. if (!inject) return
  5679. inject("data-v-183f85bc_0", { source: ".dv-decoration-5 {\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-decoration-5 {\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  5680. };
  5681. /* scoped */
  5682. const __vue_scope_id__$j = undefined;
  5683. /* module identifier */
  5684. const __vue_module_identifier__$j = undefined;
  5685. /* functional template */
  5686. const __vue_is_functional_template__$j = false;
  5687. /* style inject SSR */
  5688. /* style inject shadow dom */
  5689. const __vue_component__$j = /*#__PURE__*/normalizeComponent(
  5690. { render: __vue_render__$j, staticRenderFns: __vue_staticRenderFns__$j },
  5691. __vue_inject_styles__$j,
  5692. __vue_script__$j,
  5693. __vue_scope_id__$j,
  5694. __vue_is_functional_template__$j,
  5695. __vue_module_identifier__$j,
  5696. false,
  5697. createInjector,
  5698. undefined,
  5699. undefined
  5700. );
  5701. function decoration5 (Vue) {
  5702. Vue.component(__vue_component__$j.name, __vue_component__$j);
  5703. }
  5704. //
  5705. var script$k = {
  5706. name: 'DvDecoration6',
  5707. mixins: [autoResize],
  5708. props: {
  5709. color: {
  5710. type: Array,
  5711. default: () => []
  5712. }
  5713. },
  5714. data() {
  5715. const rectWidth = 7;
  5716. return {
  5717. ref: 'decoration-6',
  5718. svgWH: [300, 35],
  5719. svgScale: [1, 1],
  5720. rowNum: 1,
  5721. rowPoints: 40,
  5722. rectWidth,
  5723. halfRectWidth: rectWidth / 2,
  5724. points: [],
  5725. heights: [],
  5726. minHeights: [],
  5727. randoms: [],
  5728. defaultColor: ['#7acaec', '#7acaec'],
  5729. mergedColor: []
  5730. };
  5731. },
  5732. watch: {
  5733. color() {
  5734. const {
  5735. mergeColor
  5736. } = this;
  5737. mergeColor();
  5738. }
  5739. },
  5740. methods: {
  5741. afterAutoResizeMixinInit() {
  5742. const {
  5743. calcSVGData
  5744. } = this;
  5745. calcSVGData();
  5746. },
  5747. calcSVGData() {
  5748. const {
  5749. calcPointsPosition,
  5750. calcScale
  5751. } = this;
  5752. calcPointsPosition();
  5753. calcScale();
  5754. },
  5755. calcPointsPosition() {
  5756. const {
  5757. svgWH,
  5758. rowNum,
  5759. rowPoints
  5760. } = this;
  5761. const [w, h] = svgWH;
  5762. const horizontalGap = w / (rowPoints + 1);
  5763. const verticalGap = h / (rowNum + 1);
  5764. let points = new Array(rowNum).fill(0).map((foo, i) => new Array(rowPoints).fill(0).map((foo, j) => [horizontalGap * (j + 1), verticalGap * (i + 1)]));
  5765. this.points = points.reduce((all, item) => [...all, ...item], []);
  5766. const heights = this.heights = new Array(rowNum * rowPoints).fill(0).map(foo => Math.random() > 0.8 ? randomExtend(0.7 * h, h) : randomExtend(0.2 * h, 0.5 * h));
  5767. this.minHeights = new Array(rowNum * rowPoints).fill(0).map((foo, i) => heights[i] * Math.random());
  5768. this.randoms = new Array(rowNum * rowPoints).fill(0).map(foo => Math.random() + 1.5);
  5769. },
  5770. calcScale() {
  5771. const {
  5772. width,
  5773. height,
  5774. svgWH
  5775. } = this;
  5776. const [w, h] = svgWH;
  5777. this.svgScale = [width / w, height / h];
  5778. },
  5779. onResize() {
  5780. const {
  5781. calcSVGData
  5782. } = this;
  5783. calcSVGData();
  5784. },
  5785. mergeColor() {
  5786. const {
  5787. color,
  5788. defaultColor
  5789. } = this;
  5790. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  5791. }
  5792. },
  5793. mounted() {
  5794. const {
  5795. mergeColor
  5796. } = this;
  5797. mergeColor();
  5798. }
  5799. };
  5800. /* script */
  5801. const __vue_script__$k = script$k;
  5802. /* template */
  5803. var __vue_render__$k = function() {
  5804. var _vm = this;
  5805. var _h = _vm.$createElement;
  5806. var _c = _vm._self._c || _h;
  5807. return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-6" }, [
  5808. _c(
  5809. "svg",
  5810. {
  5811. style:
  5812. "transform:scale(" + _vm.svgScale[0] + "," + _vm.svgScale[1] + ");",
  5813. attrs: { width: _vm.svgWH[0] + "px", height: _vm.svgWH[1] + "px" }
  5814. },
  5815. [
  5816. _vm._l(_vm.points, function(point, i) {
  5817. return [
  5818. _c(
  5819. "rect",
  5820. {
  5821. key: i,
  5822. attrs: {
  5823. fill: _vm.mergedColor[Math.random() > 0.5 ? 0 : 1],
  5824. x: point[0] - _vm.halfRectWidth,
  5825. y: point[1] - _vm.heights[i] / 2,
  5826. width: _vm.rectWidth,
  5827. height: _vm.heights[i]
  5828. }
  5829. },
  5830. [
  5831. _c("animate", {
  5832. attrs: {
  5833. attributeName: "y",
  5834. values:
  5835. point[1] -
  5836. _vm.minHeights[i] / 2 +
  5837. ";" +
  5838. (point[1] - _vm.heights[i] / 2) +
  5839. ";" +
  5840. (point[1] - _vm.minHeights[i] / 2),
  5841. dur: _vm.randoms[i] + "s",
  5842. keyTimes: "0;0.5;1",
  5843. calcMode: "spline",
  5844. keySplines: "0.42,0,0.58,1;0.42,0,0.58,1",
  5845. begin: "0s",
  5846. repeatCount: "indefinite"
  5847. }
  5848. }),
  5849. _vm._v(" "),
  5850. _c("animate", {
  5851. attrs: {
  5852. attributeName: "height",
  5853. values:
  5854. _vm.minHeights[i] +
  5855. ";" +
  5856. _vm.heights[i] +
  5857. ";" +
  5858. _vm.minHeights[i],
  5859. dur: _vm.randoms[i] + "s",
  5860. keyTimes: "0;0.5;1",
  5861. calcMode: "spline",
  5862. keySplines: "0.42,0,0.58,1;0.42,0,0.58,1",
  5863. begin: "0s",
  5864. repeatCount: "indefinite"
  5865. }
  5866. })
  5867. ]
  5868. )
  5869. ]
  5870. })
  5871. ],
  5872. 2
  5873. )
  5874. ])
  5875. };
  5876. var __vue_staticRenderFns__$k = [];
  5877. __vue_render__$k._withStripped = true;
  5878. /* style */
  5879. const __vue_inject_styles__$k = function (inject) {
  5880. if (!inject) return
  5881. inject("data-v-a29c4fc2_0", { source: ".dv-decoration-6 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-6 svg {\n transform-origin: left top;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,0BAA0B;AAC5B","file":"main.vue","sourcesContent":[".dv-decoration-6 {\n width: 100%;\n height: 100%;\n}\n.dv-decoration-6 svg {\n transform-origin: left top;\n}\n"]}, media: undefined });
  5882. };
  5883. /* scoped */
  5884. const __vue_scope_id__$k = undefined;
  5885. /* module identifier */
  5886. const __vue_module_identifier__$k = undefined;
  5887. /* functional template */
  5888. const __vue_is_functional_template__$k = false;
  5889. /* style inject SSR */
  5890. /* style inject shadow dom */
  5891. const __vue_component__$k = /*#__PURE__*/normalizeComponent(
  5892. { render: __vue_render__$k, staticRenderFns: __vue_staticRenderFns__$k },
  5893. __vue_inject_styles__$k,
  5894. __vue_script__$k,
  5895. __vue_scope_id__$k,
  5896. __vue_is_functional_template__$k,
  5897. __vue_module_identifier__$k,
  5898. false,
  5899. createInjector,
  5900. undefined,
  5901. undefined
  5902. );
  5903. function decoration6 (Vue) {
  5904. Vue.component(__vue_component__$k.name, __vue_component__$k);
  5905. }
  5906. //
  5907. var script$l = {
  5908. name: 'DvDecoration7',
  5909. props: {
  5910. color: {
  5911. type: Array,
  5912. default: () => []
  5913. }
  5914. },
  5915. data() {
  5916. return {
  5917. defaultColor: ['#1dc1f5', '#1dc1f5'],
  5918. mergedColor: []
  5919. };
  5920. },
  5921. watch: {
  5922. color() {
  5923. const {
  5924. mergeColor
  5925. } = this;
  5926. mergeColor();
  5927. }
  5928. },
  5929. methods: {
  5930. mergeColor() {
  5931. const {
  5932. color,
  5933. defaultColor
  5934. } = this;
  5935. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  5936. }
  5937. },
  5938. mounted() {
  5939. const {
  5940. mergeColor
  5941. } = this;
  5942. mergeColor();
  5943. }
  5944. };
  5945. /* script */
  5946. const __vue_script__$l = script$l;
  5947. /* template */
  5948. var __vue_render__$l = function() {
  5949. var _vm = this;
  5950. var _h = _vm.$createElement;
  5951. var _c = _vm._self._c || _h;
  5952. return _c(
  5953. "div",
  5954. { staticClass: "dv-decoration-7" },
  5955. [
  5956. _c("svg", { attrs: { width: "21px", height: "20px" } }, [
  5957. _c("polyline", {
  5958. attrs: {
  5959. "stroke-width": "4",
  5960. fill: "transparent",
  5961. stroke: _vm.mergedColor[0],
  5962. points: "10, 0 19, 10 10, 20"
  5963. }
  5964. }),
  5965. _vm._v(" "),
  5966. _c("polyline", {
  5967. attrs: {
  5968. "stroke-width": "2",
  5969. fill: "transparent",
  5970. stroke: _vm.mergedColor[1],
  5971. points: "2, 0 11, 10 2, 20"
  5972. }
  5973. })
  5974. ]),
  5975. _vm._v(" "),
  5976. _vm._t("default"),
  5977. _vm._v(" "),
  5978. _c("svg", { attrs: { width: "21px", height: "20px" } }, [
  5979. _c("polyline", {
  5980. attrs: {
  5981. "stroke-width": "4",
  5982. fill: "transparent",
  5983. stroke: _vm.mergedColor[0],
  5984. points: "11, 0 2, 10 11, 20"
  5985. }
  5986. }),
  5987. _vm._v(" "),
  5988. _c("polyline", {
  5989. attrs: {
  5990. "stroke-width": "2",
  5991. fill: "transparent",
  5992. stroke: _vm.mergedColor[1],
  5993. points: "19, 0 10, 10 19, 20"
  5994. }
  5995. })
  5996. ])
  5997. ],
  5998. 2
  5999. )
  6000. };
  6001. var __vue_staticRenderFns__$l = [];
  6002. __vue_render__$l._withStripped = true;
  6003. /* style */
  6004. const __vue_inject_styles__$l = function (inject) {
  6005. if (!inject) return
  6006. inject("data-v-b84d1f12_0", { source: ".dv-decoration-7 {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,WAAW;EACX,YAAY;EACZ,uBAAuB;EACvB,mBAAmB;AACrB","file":"main.vue","sourcesContent":[".dv-decoration-7 {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n}\n"]}, media: undefined });
  6007. };
  6008. /* scoped */
  6009. const __vue_scope_id__$l = undefined;
  6010. /* module identifier */
  6011. const __vue_module_identifier__$l = undefined;
  6012. /* functional template */
  6013. const __vue_is_functional_template__$l = false;
  6014. /* style inject SSR */
  6015. /* style inject shadow dom */
  6016. const __vue_component__$l = /*#__PURE__*/normalizeComponent(
  6017. { render: __vue_render__$l, staticRenderFns: __vue_staticRenderFns__$l },
  6018. __vue_inject_styles__$l,
  6019. __vue_script__$l,
  6020. __vue_scope_id__$l,
  6021. __vue_is_functional_template__$l,
  6022. __vue_module_identifier__$l,
  6023. false,
  6024. createInjector,
  6025. undefined,
  6026. undefined
  6027. );
  6028. function decoration7 (Vue) {
  6029. Vue.component(__vue_component__$l.name, __vue_component__$l);
  6030. }
  6031. //
  6032. var script$m = {
  6033. name: 'DvDecoration8',
  6034. mixins: [autoResize],
  6035. props: {
  6036. color: {
  6037. type: Array,
  6038. default: () => []
  6039. },
  6040. reverse: {
  6041. type: Boolean,
  6042. default: false
  6043. }
  6044. },
  6045. data() {
  6046. return {
  6047. ref: 'decoration-8',
  6048. defaultColor: ['#3f96a5', '#3f96a5'],
  6049. mergedColor: []
  6050. };
  6051. },
  6052. watch: {
  6053. color() {
  6054. const {
  6055. mergeColor
  6056. } = this;
  6057. mergeColor();
  6058. }
  6059. },
  6060. methods: {
  6061. xPos(pos) {
  6062. const {
  6063. reverse,
  6064. width
  6065. } = this;
  6066. if (!reverse) return pos;
  6067. return width - pos;
  6068. },
  6069. mergeColor() {
  6070. const {
  6071. color,
  6072. defaultColor
  6073. } = this;
  6074. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  6075. }
  6076. },
  6077. mounted() {
  6078. const {
  6079. mergeColor
  6080. } = this;
  6081. mergeColor();
  6082. }
  6083. };
  6084. /* script */
  6085. const __vue_script__$m = script$m;
  6086. /* template */
  6087. var __vue_render__$m = function() {
  6088. var _vm = this;
  6089. var _h = _vm.$createElement;
  6090. var _c = _vm._self._c || _h;
  6091. return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-8" }, [
  6092. _c("svg", { attrs: { width: _vm.width, height: _vm.height } }, [
  6093. _c("polyline", {
  6094. attrs: {
  6095. stroke: _vm.mergedColor[0],
  6096. "stroke-width": "2",
  6097. fill: "transparent",
  6098. points: _vm.xPos(0) + ", 0 " + _vm.xPos(30) + ", " + _vm.height / 2
  6099. }
  6100. }),
  6101. _vm._v(" "),
  6102. _c("polyline", {
  6103. attrs: {
  6104. stroke: _vm.mergedColor[0],
  6105. "stroke-width": "2",
  6106. fill: "transparent",
  6107. points:
  6108. _vm.xPos(20) +
  6109. ", 0 " +
  6110. _vm.xPos(50) +
  6111. ", " +
  6112. _vm.height / 2 +
  6113. " " +
  6114. _vm.xPos(_vm.width) +
  6115. ", " +
  6116. _vm.height / 2
  6117. }
  6118. }),
  6119. _vm._v(" "),
  6120. _c("polyline", {
  6121. attrs: {
  6122. stroke: _vm.mergedColor[1],
  6123. fill: "transparent",
  6124. "stroke-width": "3",
  6125. points:
  6126. _vm.xPos(0) +
  6127. ", " +
  6128. (_vm.height - 3) +
  6129. ", " +
  6130. _vm.xPos(200) +
  6131. ", " +
  6132. (_vm.height - 3)
  6133. }
  6134. })
  6135. ])
  6136. ])
  6137. };
  6138. var __vue_staticRenderFns__$m = [];
  6139. __vue_render__$m._withStripped = true;
  6140. /* style */
  6141. const __vue_inject_styles__$m = function (inject) {
  6142. if (!inject) return
  6143. inject("data-v-53cf43a5_0", { source: ".dv-decoration-8 {\n display: flex;\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-decoration-8 {\n display: flex;\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  6144. };
  6145. /* scoped */
  6146. const __vue_scope_id__$m = undefined;
  6147. /* module identifier */
  6148. const __vue_module_identifier__$m = undefined;
  6149. /* functional template */
  6150. const __vue_is_functional_template__$m = false;
  6151. /* style inject SSR */
  6152. /* style inject shadow dom */
  6153. const __vue_component__$m = /*#__PURE__*/normalizeComponent(
  6154. { render: __vue_render__$m, staticRenderFns: __vue_staticRenderFns__$m },
  6155. __vue_inject_styles__$m,
  6156. __vue_script__$m,
  6157. __vue_scope_id__$m,
  6158. __vue_is_functional_template__$m,
  6159. __vue_module_identifier__$m,
  6160. false,
  6161. createInjector,
  6162. undefined,
  6163. undefined
  6164. );
  6165. function decoration8 (Vue) {
  6166. Vue.component(__vue_component__$m.name, __vue_component__$m);
  6167. }
  6168. //
  6169. var script$n = {
  6170. name: 'DvDecoration9',
  6171. mixins: [autoResize],
  6172. props: {
  6173. color: {
  6174. type: Array,
  6175. default: () => []
  6176. },
  6177. dur: {
  6178. type: Number,
  6179. default: 3
  6180. }
  6181. },
  6182. data() {
  6183. const id = uuid();
  6184. return {
  6185. ref: 'decoration-9',
  6186. polygonId: `decoration-9-polygon-${id}`,
  6187. svgWH: [100, 100],
  6188. svgScale: [1, 1],
  6189. defaultColor: ['rgba(3, 166, 224, 0.8)', 'rgba(3, 166, 224, 0.5)'],
  6190. mergedColor: []
  6191. };
  6192. },
  6193. watch: {
  6194. color() {
  6195. const {
  6196. mergeColor
  6197. } = this;
  6198. mergeColor();
  6199. }
  6200. },
  6201. methods: {
  6202. afterAutoResizeMixinInit() {
  6203. const {
  6204. calcScale
  6205. } = this;
  6206. calcScale();
  6207. },
  6208. calcScale() {
  6209. const {
  6210. width,
  6211. height,
  6212. svgWH
  6213. } = this;
  6214. const [w, h] = svgWH;
  6215. this.svgScale = [width / w, height / h];
  6216. },
  6217. onResize() {
  6218. const {
  6219. calcScale
  6220. } = this;
  6221. calcScale();
  6222. },
  6223. mergeColor() {
  6224. const {
  6225. color,
  6226. defaultColor
  6227. } = this;
  6228. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  6229. },
  6230. fade: lib_9
  6231. },
  6232. mounted() {
  6233. const {
  6234. mergeColor
  6235. } = this;
  6236. mergeColor();
  6237. }
  6238. };
  6239. /* script */
  6240. const __vue_script__$n = script$n;
  6241. /* template */
  6242. var __vue_render__$n = function() {
  6243. var _vm = this;
  6244. var _h = _vm.$createElement;
  6245. var _c = _vm._self._c || _h;
  6246. return _c(
  6247. "div",
  6248. { ref: _vm.ref, staticClass: "dv-decoration-9" },
  6249. [
  6250. _c(
  6251. "svg",
  6252. {
  6253. style:
  6254. "transform:scale(" + _vm.svgScale[0] + "," + _vm.svgScale[1] + ");",
  6255. attrs: { width: _vm.svgWH[0] + "px", height: _vm.svgWH[1] + "px" }
  6256. },
  6257. [
  6258. _c("defs", [
  6259. _c("polygon", {
  6260. attrs: {
  6261. id: _vm.polygonId,
  6262. points: "15, 46.5, 21, 47.5, 21, 52.5, 15, 53.5"
  6263. }
  6264. })
  6265. ]),
  6266. _vm._v(" "),
  6267. _c(
  6268. "circle",
  6269. {
  6270. attrs: {
  6271. cx: "50",
  6272. cy: "50",
  6273. r: "45",
  6274. fill: "transparent",
  6275. stroke: _vm.mergedColor[1],
  6276. "stroke-width": "10",
  6277. "stroke-dasharray": "80, 100, 30, 100"
  6278. }
  6279. },
  6280. [
  6281. _c("animateTransform", {
  6282. attrs: {
  6283. attributeName: "transform",
  6284. type: "rotate",
  6285. values: "0 50 50;360 50 50",
  6286. dur: _vm.dur + "s",
  6287. repeatCount: "indefinite"
  6288. }
  6289. })
  6290. ],
  6291. 1
  6292. ),
  6293. _vm._v(" "),
  6294. _c(
  6295. "circle",
  6296. {
  6297. attrs: {
  6298. cx: "50",
  6299. cy: "50",
  6300. r: "45",
  6301. fill: "transparent",
  6302. stroke: _vm.mergedColor[0],
  6303. "stroke-width": "6",
  6304. "stroke-dasharray": "50, 66, 100, 66"
  6305. }
  6306. },
  6307. [
  6308. _c("animateTransform", {
  6309. attrs: {
  6310. attributeName: "transform",
  6311. type: "rotate",
  6312. values: "0 50 50;-360 50 50",
  6313. dur: _vm.dur + "s",
  6314. repeatCount: "indefinite"
  6315. }
  6316. })
  6317. ],
  6318. 1
  6319. ),
  6320. _vm._v(" "),
  6321. _c("circle", {
  6322. attrs: {
  6323. cx: "50",
  6324. cy: "50",
  6325. r: "38",
  6326. fill: "transparent",
  6327. stroke: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 30),
  6328. "stroke-width": "1",
  6329. "stroke-dasharray": "5, 1"
  6330. }
  6331. }),
  6332. _vm._v(" "),
  6333. _vm._l(new Array(20).fill(0), function(foo, i) {
  6334. return _c(
  6335. "use",
  6336. {
  6337. key: i,
  6338. attrs: {
  6339. "xlink:href": "#" + _vm.polygonId,
  6340. stroke: _vm.mergedColor[1],
  6341. fill: Math.random() > 0.4 ? "transparent" : _vm.mergedColor[0]
  6342. }
  6343. },
  6344. [
  6345. _c("animateTransform", {
  6346. attrs: {
  6347. attributeName: "transform",
  6348. type: "rotate",
  6349. values: "0 50 50;360 50 50",
  6350. dur: _vm.dur + "s",
  6351. begin: (i * _vm.dur) / 20 + "s",
  6352. repeatCount: "indefinite"
  6353. }
  6354. })
  6355. ],
  6356. 1
  6357. )
  6358. }),
  6359. _vm._v(" "),
  6360. _c("circle", {
  6361. attrs: {
  6362. cx: "50",
  6363. cy: "50",
  6364. r: "26",
  6365. fill: "transparent",
  6366. stroke: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 30),
  6367. "stroke-width": "1",
  6368. "stroke-dasharray": "5, 1"
  6369. }
  6370. })
  6371. ],
  6372. 2
  6373. ),
  6374. _vm._v(" "),
  6375. _vm._t("default")
  6376. ],
  6377. 2
  6378. )
  6379. };
  6380. var __vue_staticRenderFns__$n = [];
  6381. __vue_render__$n._withStripped = true;
  6382. /* style */
  6383. const __vue_inject_styles__$n = function (inject) {
  6384. if (!inject) return
  6385. inject("data-v-b47f91a8_0", { source: ".dv-decoration-9 {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.dv-decoration-9 svg {\n position: absolute;\n left: 0px;\n top: 0px;\n transform-origin: left top;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;AACzB;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,0BAA0B;AAC5B","file":"main.vue","sourcesContent":[".dv-decoration-9 {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.dv-decoration-9 svg {\n position: absolute;\n left: 0px;\n top: 0px;\n transform-origin: left top;\n}\n"]}, media: undefined });
  6386. };
  6387. /* scoped */
  6388. const __vue_scope_id__$n = undefined;
  6389. /* module identifier */
  6390. const __vue_module_identifier__$n = undefined;
  6391. /* functional template */
  6392. const __vue_is_functional_template__$n = false;
  6393. /* style inject SSR */
  6394. /* style inject shadow dom */
  6395. const __vue_component__$n = /*#__PURE__*/normalizeComponent(
  6396. { render: __vue_render__$n, staticRenderFns: __vue_staticRenderFns__$n },
  6397. __vue_inject_styles__$n,
  6398. __vue_script__$n,
  6399. __vue_scope_id__$n,
  6400. __vue_is_functional_template__$n,
  6401. __vue_module_identifier__$n,
  6402. false,
  6403. createInjector,
  6404. undefined,
  6405. undefined
  6406. );
  6407. function decoration9 (Vue) {
  6408. Vue.component(__vue_component__$n.name, __vue_component__$n);
  6409. }
  6410. //
  6411. var script$o = {
  6412. name: 'DvDecoration10',
  6413. mixins: [autoResize],
  6414. props: {
  6415. color: {
  6416. type: Array,
  6417. default: () => []
  6418. }
  6419. },
  6420. data() {
  6421. const id = uuid();
  6422. return {
  6423. ref: 'decoration-10',
  6424. animationId1: `d10ani1${id}`,
  6425. animationId2: `d10ani2${id}`,
  6426. animationId3: `d10ani3${id}`,
  6427. animationId4: `d10ani4${id}`,
  6428. animationId5: `d10ani5${id}`,
  6429. animationId6: `d10ani6${id}`,
  6430. animationId7: `d10ani7${id}`,
  6431. defaultColor: ['#00c2ff', 'rgba(0, 194, 255, 0.3)'],
  6432. mergedColor: []
  6433. };
  6434. },
  6435. watch: {
  6436. color() {
  6437. const {
  6438. mergeColor
  6439. } = this;
  6440. mergeColor();
  6441. }
  6442. },
  6443. methods: {
  6444. mergeColor() {
  6445. const {
  6446. color,
  6447. defaultColor
  6448. } = this;
  6449. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  6450. }
  6451. },
  6452. mounted() {
  6453. const {
  6454. mergeColor
  6455. } = this;
  6456. mergeColor();
  6457. }
  6458. };
  6459. /* script */
  6460. const __vue_script__$o = script$o;
  6461. /* template */
  6462. var __vue_render__$o = function() {
  6463. var _vm = this;
  6464. var _h = _vm.$createElement;
  6465. var _c = _vm._self._c || _h;
  6466. return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-10" }, [
  6467. _c("svg", { attrs: { width: _vm.width, height: _vm.height } }, [
  6468. _c("polyline", {
  6469. attrs: {
  6470. stroke: _vm.mergedColor[1],
  6471. "stroke-width": "2",
  6472. points:
  6473. "0, " + _vm.height / 2 + " " + _vm.width + ", " + _vm.height / 2
  6474. }
  6475. }),
  6476. _vm._v(" "),
  6477. _c(
  6478. "polyline",
  6479. {
  6480. attrs: {
  6481. stroke: _vm.mergedColor[0],
  6482. "stroke-width": "2",
  6483. points:
  6484. "5, " +
  6485. _vm.height / 2 +
  6486. " " +
  6487. (_vm.width * 0.2 - 3) +
  6488. ", " +
  6489. _vm.height / 2,
  6490. "stroke-dasharray": "0, " + _vm.width * 0.2,
  6491. fill: "freeze"
  6492. }
  6493. },
  6494. [
  6495. _c("animate", {
  6496. attrs: {
  6497. id: _vm.animationId2,
  6498. attributeName: "stroke-dasharray",
  6499. values: "0, " + _vm.width * 0.2 + ";" + _vm.width * 0.2 + ", 0;",
  6500. dur: "3s",
  6501. begin: _vm.animationId1 + ".end",
  6502. fill: "freeze"
  6503. }
  6504. }),
  6505. _vm._v(" "),
  6506. _c("animate", {
  6507. attrs: {
  6508. attributeName: "stroke-dasharray",
  6509. values: _vm.width * 0.2 + ", 0;0, " + _vm.width * 0.2,
  6510. dur: "0.01s",
  6511. begin: _vm.animationId7 + ".end",
  6512. fill: "freeze"
  6513. }
  6514. })
  6515. ]
  6516. ),
  6517. _vm._v(" "),
  6518. _c(
  6519. "polyline",
  6520. {
  6521. attrs: {
  6522. stroke: _vm.mergedColor[0],
  6523. "stroke-width": "2",
  6524. points:
  6525. _vm.width * 0.2 +
  6526. 3 +
  6527. ", " +
  6528. _vm.height / 2 +
  6529. " " +
  6530. (_vm.width * 0.8 - 3) +
  6531. ", " +
  6532. _vm.height / 2,
  6533. "stroke-dasharray": "0, " + _vm.width * 0.6
  6534. }
  6535. },
  6536. [
  6537. _c("animate", {
  6538. attrs: {
  6539. id: _vm.animationId4,
  6540. attributeName: "stroke-dasharray",
  6541. values: "0, " + _vm.width * 0.6 + ";" + _vm.width * 0.6 + ", 0",
  6542. dur: "3s",
  6543. begin: _vm.animationId3 + ".end + 1s",
  6544. fill: "freeze"
  6545. }
  6546. }),
  6547. _vm._v(" "),
  6548. _c("animate", {
  6549. attrs: {
  6550. attributeName: "stroke-dasharray",
  6551. values: _vm.width * 0.6 + ", 0;0, " + _vm.width * 0.6,
  6552. dur: "0.01s",
  6553. begin: _vm.animationId7 + ".end",
  6554. fill: "freeze"
  6555. }
  6556. })
  6557. ]
  6558. ),
  6559. _vm._v(" "),
  6560. _c(
  6561. "polyline",
  6562. {
  6563. attrs: {
  6564. stroke: _vm.mergedColor[0],
  6565. "stroke-width": "2",
  6566. points:
  6567. _vm.width * 0.8 +
  6568. 3 +
  6569. ", " +
  6570. _vm.height / 2 +
  6571. " " +
  6572. (_vm.width - 5) +
  6573. ", " +
  6574. _vm.height / 2,
  6575. "stroke-dasharray": "0, " + _vm.width * 0.2
  6576. }
  6577. },
  6578. [
  6579. _c("animate", {
  6580. attrs: {
  6581. id: _vm.animationId6,
  6582. attributeName: "stroke-dasharray",
  6583. values: "0, " + _vm.width * 0.2 + ";" + _vm.width * 0.2 + ", 0",
  6584. dur: "3s",
  6585. begin: _vm.animationId5 + ".end + 1s",
  6586. fill: "freeze"
  6587. }
  6588. }),
  6589. _vm._v(" "),
  6590. _c("animate", {
  6591. attrs: {
  6592. attributeName: "stroke-dasharray",
  6593. values: _vm.width * 0.2 + ", 0;0, " + _vm.width * 0.3,
  6594. dur: "0.01s",
  6595. begin: _vm.animationId7 + ".end",
  6596. fill: "freeze"
  6597. }
  6598. })
  6599. ]
  6600. ),
  6601. _vm._v(" "),
  6602. _c(
  6603. "circle",
  6604. {
  6605. attrs: {
  6606. cx: "2",
  6607. cy: _vm.height / 2,
  6608. r: "2",
  6609. fill: _vm.mergedColor[1]
  6610. }
  6611. },
  6612. [
  6613. _c("animate", {
  6614. attrs: {
  6615. id: _vm.animationId1,
  6616. attributeName: "fill",
  6617. values: _vm.mergedColor[1] + ";" + _vm.mergedColor[0],
  6618. begin: "0s;" + _vm.animationId7 + ".end",
  6619. dur: "0.3s",
  6620. fill: "freeze"
  6621. }
  6622. })
  6623. ]
  6624. ),
  6625. _vm._v(" "),
  6626. _c(
  6627. "circle",
  6628. {
  6629. attrs: {
  6630. cx: _vm.width * 0.2,
  6631. cy: _vm.height / 2,
  6632. r: "2",
  6633. fill: _vm.mergedColor[1]
  6634. }
  6635. },
  6636. [
  6637. _c("animate", {
  6638. attrs: {
  6639. id: _vm.animationId3,
  6640. attributeName: "fill",
  6641. values: _vm.mergedColor[1] + ";" + _vm.mergedColor[0],
  6642. begin: _vm.animationId2 + ".end",
  6643. dur: "0.3s",
  6644. fill: "freeze"
  6645. }
  6646. }),
  6647. _vm._v(" "),
  6648. _c("animate", {
  6649. attrs: {
  6650. attributeName: "fill",
  6651. values: _vm.mergedColor[1] + ";" + _vm.mergedColor[1],
  6652. dur: "0.01s",
  6653. begin: _vm.animationId7 + ".end",
  6654. fill: "freeze"
  6655. }
  6656. })
  6657. ]
  6658. ),
  6659. _vm._v(" "),
  6660. _c(
  6661. "circle",
  6662. {
  6663. attrs: {
  6664. cx: _vm.width * 0.8,
  6665. cy: _vm.height / 2,
  6666. r: "2",
  6667. fill: _vm.mergedColor[1]
  6668. }
  6669. },
  6670. [
  6671. _c("animate", {
  6672. attrs: {
  6673. id: _vm.animationId5,
  6674. attributeName: "fill",
  6675. values: _vm.mergedColor[1] + ";" + _vm.mergedColor[0],
  6676. begin: _vm.animationId4 + ".end",
  6677. dur: "0.3s",
  6678. fill: "freeze"
  6679. }
  6680. }),
  6681. _vm._v(" "),
  6682. _c("animate", {
  6683. attrs: {
  6684. attributeName: "fill",
  6685. values: _vm.mergedColor[1] + ";" + _vm.mergedColor[1],
  6686. dur: "0.01s",
  6687. begin: _vm.animationId7 + ".end",
  6688. fill: "freeze"
  6689. }
  6690. })
  6691. ]
  6692. ),
  6693. _vm._v(" "),
  6694. _c(
  6695. "circle",
  6696. {
  6697. attrs: {
  6698. cx: _vm.width - 2,
  6699. cy: _vm.height / 2,
  6700. r: "2",
  6701. fill: _vm.mergedColor[1]
  6702. }
  6703. },
  6704. [
  6705. _c("animate", {
  6706. attrs: {
  6707. id: _vm.animationId7,
  6708. attributeName: "fill",
  6709. values: _vm.mergedColor[1] + ";" + _vm.mergedColor[0],
  6710. begin: _vm.animationId6 + ".end",
  6711. dur: "0.3s",
  6712. fill: "freeze"
  6713. }
  6714. }),
  6715. _vm._v(" "),
  6716. _c("animate", {
  6717. attrs: {
  6718. attributeName: "fill",
  6719. values: _vm.mergedColor[1] + ";" + _vm.mergedColor[1],
  6720. dur: "0.01s",
  6721. begin: _vm.animationId7 + ".end",
  6722. fill: "freeze"
  6723. }
  6724. })
  6725. ]
  6726. )
  6727. ])
  6728. ])
  6729. };
  6730. var __vue_staticRenderFns__$o = [];
  6731. __vue_render__$o._withStripped = true;
  6732. /* style */
  6733. const __vue_inject_styles__$o = function (inject) {
  6734. if (!inject) return
  6735. inject("data-v-23172a05_0", { source: ".dv-decoration-10 {\n width: 100%;\n height: 100%;\n display: flex;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;EACZ,aAAa;AACf","file":"main.vue","sourcesContent":[".dv-decoration-10 {\n width: 100%;\n height: 100%;\n display: flex;\n}\n"]}, media: undefined });
  6736. };
  6737. /* scoped */
  6738. const __vue_scope_id__$o = undefined;
  6739. /* module identifier */
  6740. const __vue_module_identifier__$o = undefined;
  6741. /* functional template */
  6742. const __vue_is_functional_template__$o = false;
  6743. /* style inject SSR */
  6744. /* style inject shadow dom */
  6745. const __vue_component__$o = /*#__PURE__*/normalizeComponent(
  6746. { render: __vue_render__$o, staticRenderFns: __vue_staticRenderFns__$o },
  6747. __vue_inject_styles__$o,
  6748. __vue_script__$o,
  6749. __vue_scope_id__$o,
  6750. __vue_is_functional_template__$o,
  6751. __vue_module_identifier__$o,
  6752. false,
  6753. createInjector,
  6754. undefined,
  6755. undefined
  6756. );
  6757. function decoration10 (Vue) {
  6758. Vue.component(__vue_component__$o.name, __vue_component__$o);
  6759. }
  6760. //
  6761. var script$p = {
  6762. name: 'DvDecoration11',
  6763. mixins: [autoResize],
  6764. props: {
  6765. color: {
  6766. type: Array,
  6767. default: () => []
  6768. }
  6769. },
  6770. data() {
  6771. return {
  6772. ref: 'decoration-11',
  6773. defaultColor: ['#1a98fc', '#2cf7fe'],
  6774. mergedColor: []
  6775. };
  6776. },
  6777. watch: {
  6778. color() {
  6779. const {
  6780. mergeColor
  6781. } = this;
  6782. mergeColor();
  6783. }
  6784. },
  6785. methods: {
  6786. mergeColor() {
  6787. const {
  6788. color,
  6789. defaultColor
  6790. } = this;
  6791. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  6792. },
  6793. fade: lib_9
  6794. },
  6795. mounted() {
  6796. const {
  6797. mergeColor
  6798. } = this;
  6799. mergeColor();
  6800. }
  6801. };
  6802. /* script */
  6803. const __vue_script__$p = script$p;
  6804. /* template */
  6805. var __vue_render__$p = function() {
  6806. var _vm = this;
  6807. var _h = _vm.$createElement;
  6808. var _c = _vm._self._c || _h;
  6809. return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-11" }, [
  6810. _c("svg", { attrs: { width: _vm.width, height: _vm.height } }, [
  6811. _c("polygon", {
  6812. attrs: {
  6813. fill: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 10),
  6814. stroke: _vm.mergedColor[1],
  6815. points: "20 10, 25 4, 55 4 60 10"
  6816. }
  6817. }),
  6818. _vm._v(" "),
  6819. _c("polygon", {
  6820. attrs: {
  6821. fill: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 10),
  6822. stroke: _vm.mergedColor[1],
  6823. points:
  6824. "20 " +
  6825. (_vm.height - 10) +
  6826. ", 25 " +
  6827. (_vm.height - 4) +
  6828. ", 55 " +
  6829. (_vm.height - 4) +
  6830. " 60 " +
  6831. (_vm.height - 10)
  6832. }
  6833. }),
  6834. _vm._v(" "),
  6835. _c("polygon", {
  6836. attrs: {
  6837. fill: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 10),
  6838. stroke: _vm.mergedColor[1],
  6839. points:
  6840. _vm.width -
  6841. 20 +
  6842. " 10, " +
  6843. (_vm.width - 25) +
  6844. " 4, " +
  6845. (_vm.width - 55) +
  6846. " 4 " +
  6847. (_vm.width - 60) +
  6848. " 10"
  6849. }
  6850. }),
  6851. _vm._v(" "),
  6852. _c("polygon", {
  6853. attrs: {
  6854. fill: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 10),
  6855. stroke: _vm.mergedColor[1],
  6856. points:
  6857. _vm.width -
  6858. 20 +
  6859. " " +
  6860. (_vm.height - 10) +
  6861. ", " +
  6862. (_vm.width - 25) +
  6863. " " +
  6864. (_vm.height - 4) +
  6865. ", " +
  6866. (_vm.width - 55) +
  6867. " " +
  6868. (_vm.height - 4) +
  6869. " " +
  6870. (_vm.width - 60) +
  6871. " " +
  6872. (_vm.height - 10)
  6873. }
  6874. }),
  6875. _vm._v(" "),
  6876. _c("polygon", {
  6877. attrs: {
  6878. fill: _vm.fade(_vm.mergedColor[0] || _vm.defaultColor[0], 20),
  6879. stroke: _vm.mergedColor[0],
  6880. points:
  6881. "\n 20 10, 5 " +
  6882. _vm.height / 2 +
  6883. " 20 " +
  6884. (_vm.height - 10) +
  6885. "\n " +
  6886. (_vm.width - 20) +
  6887. " " +
  6888. (_vm.height - 10) +
  6889. " " +
  6890. (_vm.width - 5) +
  6891. " " +
  6892. _vm.height / 2 +
  6893. " " +
  6894. (_vm.width - 20) +
  6895. " 10\n "
  6896. }
  6897. }),
  6898. _vm._v(" "),
  6899. _c("polyline", {
  6900. attrs: {
  6901. fill: "transparent",
  6902. stroke: _vm.fade(_vm.mergedColor[0] || _vm.defaultColor[0], 70),
  6903. points: "25 18, 15 " + _vm.height / 2 + " 25 " + (_vm.height - 18)
  6904. }
  6905. }),
  6906. _vm._v(" "),
  6907. _c("polyline", {
  6908. attrs: {
  6909. fill: "transparent",
  6910. stroke: _vm.fade(_vm.mergedColor[0] || _vm.defaultColor[0], 70),
  6911. points:
  6912. _vm.width -
  6913. 25 +
  6914. " 18, " +
  6915. (_vm.width - 15) +
  6916. " " +
  6917. _vm.height / 2 +
  6918. " " +
  6919. (_vm.width - 25) +
  6920. " " +
  6921. (_vm.height - 18)
  6922. }
  6923. })
  6924. ]),
  6925. _vm._v(" "),
  6926. _c("div", { staticClass: "decoration-content" }, [_vm._t("default")], 2)
  6927. ])
  6928. };
  6929. var __vue_staticRenderFns__$p = [];
  6930. __vue_render__$p._withStripped = true;
  6931. /* style */
  6932. const __vue_inject_styles__$p = function (inject) {
  6933. if (!inject) return
  6934. inject("data-v-53895fd4_0", { source: ".dv-decoration-11 {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n}\n.dv-decoration-11 .decoration-content {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,WAAW;EACX,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;AACzB","file":"main.vue","sourcesContent":[".dv-decoration-11 {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n}\n.dv-decoration-11 .decoration-content {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n"]}, media: undefined });
  6935. };
  6936. /* scoped */
  6937. const __vue_scope_id__$p = undefined;
  6938. /* module identifier */
  6939. const __vue_module_identifier__$p = undefined;
  6940. /* functional template */
  6941. const __vue_is_functional_template__$p = false;
  6942. /* style inject SSR */
  6943. /* style inject shadow dom */
  6944. const __vue_component__$p = /*#__PURE__*/normalizeComponent(
  6945. { render: __vue_render__$p, staticRenderFns: __vue_staticRenderFns__$p },
  6946. __vue_inject_styles__$p,
  6947. __vue_script__$p,
  6948. __vue_scope_id__$p,
  6949. __vue_is_functional_template__$p,
  6950. __vue_module_identifier__$p,
  6951. false,
  6952. createInjector,
  6953. undefined,
  6954. undefined
  6955. );
  6956. function decoration11 (Vue) {
  6957. Vue.component(__vue_component__$p.name, __vue_component__$p);
  6958. }
  6959. //
  6960. var script$q = {
  6961. name: 'DvDecoration12',
  6962. mixins: [autoResize],
  6963. props: {
  6964. color: {
  6965. type: Array,
  6966. default: () => []
  6967. },
  6968. /**
  6969. * @description Scan animation dur
  6970. */
  6971. scanDur: {
  6972. type: Number,
  6973. default: 3
  6974. },
  6975. /**
  6976. * @description Halo animation dur
  6977. */
  6978. haloDur: {
  6979. type: Number,
  6980. default: 2
  6981. }
  6982. },
  6983. data() {
  6984. const id = uuid();
  6985. return {
  6986. ref: 'decoration-12',
  6987. gId: `decoration-12-g-${id}`,
  6988. gradientId: `decoration-12-gradient-${id}`,
  6989. defaultColor: ['#2783ce', '#2cf7fe'],
  6990. mergedColor: [],
  6991. pathD: [],
  6992. pathColor: [],
  6993. circleR: [],
  6994. splitLinePoints: [],
  6995. arcD: [],
  6996. segment: 30,
  6997. sectorAngle: Math.PI / 3,
  6998. ringNum: 3,
  6999. ringWidth: 1,
  7000. showSplitLine: true
  7001. };
  7002. },
  7003. watch: {
  7004. color() {
  7005. const {
  7006. mergeColor
  7007. } = this;
  7008. mergeColor();
  7009. }
  7010. },
  7011. computed: {
  7012. x() {
  7013. const {
  7014. width
  7015. } = this;
  7016. return width / 2;
  7017. },
  7018. y() {
  7019. const {
  7020. height
  7021. } = this;
  7022. return height / 2;
  7023. }
  7024. },
  7025. methods: {
  7026. init() {
  7027. const {
  7028. mergeColor,
  7029. calcPathD,
  7030. calcPathColor,
  7031. calcCircleR,
  7032. calcSplitLinePoints,
  7033. calcArcD
  7034. } = this;
  7035. mergeColor();
  7036. calcPathD();
  7037. calcPathColor();
  7038. calcCircleR();
  7039. calcSplitLinePoints();
  7040. calcArcD();
  7041. },
  7042. mergeColor() {
  7043. const {
  7044. color,
  7045. defaultColor
  7046. } = this;
  7047. this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
  7048. },
  7049. calcPathD() {
  7050. const {
  7051. x,
  7052. y,
  7053. width,
  7054. segment,
  7055. sectorAngle
  7056. } = this;
  7057. const startAngle = -Math.PI / 2;
  7058. const angleGap = sectorAngle / segment;
  7059. const r = width / 4;
  7060. let lastEndPoints = util_13(x, y, r, startAngle);
  7061. this.pathD = new Array(segment).fill('').map((_, i) => {
  7062. const endPoints = util_13(x, y, r, startAngle - (i + 1) * angleGap).map(_ => _.toFixed(5));
  7063. const d = `M${lastEndPoints.join(',')} A${r}, ${r} 0 0 0 ${endPoints.join(',')}`;
  7064. lastEndPoints = endPoints;
  7065. return d;
  7066. });
  7067. },
  7068. calcPathColor() {
  7069. const {
  7070. mergedColor: [color],
  7071. segment
  7072. } = this;
  7073. const colorGap = 100 / (segment - 1);
  7074. this.pathColor = new Array(segment).fill(color).map((_, i) => lib_9(color, 100 - i * colorGap));
  7075. },
  7076. calcCircleR() {
  7077. const {
  7078. segment,
  7079. ringNum,
  7080. width,
  7081. ringWidth
  7082. } = this;
  7083. const radiusGap = (width / 2 - ringWidth / 2) / ringNum;
  7084. this.circleR = new Array(ringNum).fill(0).map((_, i) => radiusGap * (i + 1));
  7085. },
  7086. calcSplitLinePoints() {
  7087. const {
  7088. x,
  7089. y,
  7090. width
  7091. } = this;
  7092. const angleGap = Math.PI / 6;
  7093. const r = width / 2;
  7094. this.splitLinePoints = new Array(6).fill('').map((_, i) => {
  7095. const startAngle = angleGap * (i + 1);
  7096. const endAngle = startAngle + Math.PI;
  7097. const startPoint = util_13(x, y, r, startAngle);
  7098. const endPoint = util_13(x, y, r, endAngle);
  7099. return `${startPoint.join(',')} ${endPoint.join(',')}`;
  7100. });
  7101. },
  7102. calcArcD() {
  7103. const {
  7104. x,
  7105. y,
  7106. width
  7107. } = this;
  7108. const angleGap = Math.PI / 6;
  7109. const r = width / 2 - 1;
  7110. this.arcD = new Array(4).fill('').map((_, i) => {
  7111. const startAngle = angleGap * (3 * i + 1);
  7112. const endAngle = startAngle + angleGap;
  7113. const startPoint = util_13(x, y, r, startAngle);
  7114. const endPoint = util_13(x, y, r, endAngle);
  7115. return `M${startPoint.join(',')} A${x}, ${y} 0 0 1 ${endPoint.join(',')}`;
  7116. });
  7117. },
  7118. afterAutoResizeMixinInit() {
  7119. const {
  7120. init
  7121. } = this;
  7122. init();
  7123. },
  7124. fade: lib_9
  7125. }
  7126. };
  7127. /* script */
  7128. const __vue_script__$q = script$q;
  7129. /* template */
  7130. var __vue_render__$q = function() {
  7131. var _vm = this;
  7132. var _h = _vm.$createElement;
  7133. var _c = _vm._self._c || _h;
  7134. return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-12" }, [
  7135. _c(
  7136. "svg",
  7137. { attrs: { width: _vm.width, height: _vm.height } },
  7138. [
  7139. _c(
  7140. "defs",
  7141. [
  7142. _c(
  7143. "g",
  7144. { attrs: { id: _vm.gId } },
  7145. _vm._l(_vm.pathD, function(d, i) {
  7146. return _c("path", {
  7147. key: d,
  7148. attrs: {
  7149. stroke: _vm.pathColor[i],
  7150. "stroke-width": _vm.width / 2,
  7151. fill: "transparent",
  7152. d: d
  7153. }
  7154. })
  7155. }),
  7156. 0
  7157. ),
  7158. _vm._v(" "),
  7159. _c(
  7160. "radialGradient",
  7161. { attrs: { id: _vm.gradientId, cx: "50%", cy: "50%", r: "50%" } },
  7162. [
  7163. _c("stop", {
  7164. attrs: {
  7165. offset: "0%",
  7166. "stop-color": "transparent",
  7167. "stop-opacity": "1"
  7168. }
  7169. }),
  7170. _vm._v(" "),
  7171. _c("stop", {
  7172. attrs: {
  7173. offset: "100%",
  7174. "stop-color": _vm.fade(
  7175. _vm.mergedColor[1] || _vm.defaultColor[1],
  7176. 30
  7177. ),
  7178. "stop-opacity": "1"
  7179. }
  7180. })
  7181. ],
  7182. 1
  7183. )
  7184. ],
  7185. 1
  7186. ),
  7187. _vm._v(" "),
  7188. _vm._l(_vm.circleR, function(r) {
  7189. return _c("circle", {
  7190. key: r,
  7191. attrs: {
  7192. r: r,
  7193. cx: _vm.x,
  7194. cy: _vm.y,
  7195. stroke: _vm.mergedColor[1],
  7196. "stroke-width": 0.5,
  7197. fill: "transparent"
  7198. }
  7199. })
  7200. }),
  7201. _vm._v(" "),
  7202. _c(
  7203. "circle",
  7204. {
  7205. attrs: {
  7206. r: "1",
  7207. cx: _vm.x,
  7208. cy: _vm.y,
  7209. stroke: "transparent",
  7210. fill: "url(#" + _vm.gradientId + ")"
  7211. }
  7212. },
  7213. [
  7214. _c("animate", {
  7215. attrs: {
  7216. attributeName: "r",
  7217. values: "1;" + _vm.width / 2,
  7218. dur: _vm.haloDur + "s",
  7219. repeatCount: "indefinite"
  7220. }
  7221. }),
  7222. _vm._v(" "),
  7223. _c("animate", {
  7224. attrs: {
  7225. attributeName: "opacity",
  7226. values: "1;0",
  7227. dur: _vm.haloDur + "s",
  7228. repeatCount: "indefinite"
  7229. }
  7230. })
  7231. ]
  7232. ),
  7233. _vm._v(" "),
  7234. _c("circle", {
  7235. attrs: { r: "2", cx: _vm.x, cy: _vm.y, fill: _vm.mergedColor[1] }
  7236. }),
  7237. _vm._v(" "),
  7238. _vm.showSplitLine
  7239. ? _c(
  7240. "g",
  7241. _vm._l(_vm.splitLinePoints, function(p) {
  7242. return _c("polyline", {
  7243. key: p,
  7244. attrs: {
  7245. points: p,
  7246. stroke: _vm.mergedColor[1],
  7247. "stroke-width": 0.5,
  7248. opacity: "0.5"
  7249. }
  7250. })
  7251. }),
  7252. 0
  7253. )
  7254. : _vm._e(),
  7255. _vm._v(" "),
  7256. _vm._l(_vm.arcD, function(d) {
  7257. return _c("path", {
  7258. key: d,
  7259. attrs: {
  7260. d: d,
  7261. stroke: _vm.mergedColor[1],
  7262. "stroke-width": "2",
  7263. fill: "transparent"
  7264. }
  7265. })
  7266. }),
  7267. _vm._v(" "),
  7268. _c(
  7269. "use",
  7270. { attrs: { "xlink:href": "#" + _vm.gId } },
  7271. [
  7272. _c("animateTransform", {
  7273. attrs: {
  7274. attributeName: "transform",
  7275. type: "rotate",
  7276. values:
  7277. "0, " + _vm.x + " " + _vm.y + ";360, " + _vm.x + " " + _vm.y,
  7278. dur: _vm.scanDur + "s",
  7279. repeatCount: "indefinite"
  7280. }
  7281. })
  7282. ],
  7283. 1
  7284. )
  7285. ],
  7286. 2
  7287. ),
  7288. _vm._v(" "),
  7289. _c("div", { staticClass: "decoration-content" }, [_vm._t("default")], 2)
  7290. ])
  7291. };
  7292. var __vue_staticRenderFns__$q = [];
  7293. __vue_render__$q._withStripped = true;
  7294. /* style */
  7295. const __vue_inject_styles__$q = function (inject) {
  7296. if (!inject) return
  7297. inject("data-v-70099a0c_0", { source: ".dv-decoration-12 {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n}\n.dv-decoration-12 .decoration-content {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,WAAW;EACX,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;AACzB","file":"main.vue","sourcesContent":[".dv-decoration-12 {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n}\n.dv-decoration-12 .decoration-content {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n"]}, media: undefined });
  7298. };
  7299. /* scoped */
  7300. const __vue_scope_id__$q = undefined;
  7301. /* module identifier */
  7302. const __vue_module_identifier__$q = undefined;
  7303. /* functional template */
  7304. const __vue_is_functional_template__$q = false;
  7305. /* style inject SSR */
  7306. /* style inject shadow dom */
  7307. const __vue_component__$q = /*#__PURE__*/normalizeComponent(
  7308. { render: __vue_render__$q, staticRenderFns: __vue_staticRenderFns__$q },
  7309. __vue_inject_styles__$q,
  7310. __vue_script__$q,
  7311. __vue_scope_id__$q,
  7312. __vue_is_functional_template__$q,
  7313. __vue_module_identifier__$q,
  7314. false,
  7315. createInjector,
  7316. undefined,
  7317. undefined
  7318. );
  7319. function decoration12 (Vue) {
  7320. Vue.component(__vue_component__$q.name, __vue_component__$q);
  7321. }
  7322. function _classCallCheck(instance, Constructor) {
  7323. if (!(instance instanceof Constructor)) {
  7324. throw new TypeError("Cannot call a class as a function");
  7325. }
  7326. }
  7327. var classCallCheck = _classCallCheck;
  7328. function _defineProperty(obj, key, value) {
  7329. if (key in obj) {
  7330. Object.defineProperty(obj, key, {
  7331. value: value,
  7332. enumerable: true,
  7333. configurable: true,
  7334. writable: true
  7335. });
  7336. } else {
  7337. obj[key] = value;
  7338. }
  7339. return obj;
  7340. }
  7341. var defineProperty = _defineProperty;
  7342. var bezierCurveToPolyline_1 = createCommonjsModule(function (module, exports) {
  7343. Object.defineProperty(exports, "__esModule", {
  7344. value: true
  7345. });
  7346. exports.bezierCurveToPolyline = bezierCurveToPolyline;
  7347. exports.getBezierCurveLength = getBezierCurveLength;
  7348. exports["default"] = void 0;
  7349. var _slicedToArray2 = interopRequireDefault(slicedToArray);
  7350. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  7351. var sqrt = Math.sqrt,
  7352. pow = Math.pow,
  7353. ceil = Math.ceil,
  7354. abs = Math.abs; // Initialize the number of points per curve
  7355. var defaultSegmentPointsNum = 50;
  7356. /**
  7357. * @example data structure of bezierCurve
  7358. * bezierCurve = [
  7359. * // Starting point of the curve
  7360. * [10, 10],
  7361. * // BezierCurve segment data (controlPoint1, controlPoint2, endPoint)
  7362. * [
  7363. * [20, 20], [40, 20], [50, 10]
  7364. * ],
  7365. * ...
  7366. * ]
  7367. */
  7368. /**
  7369. * @description Abstract the curve as a polyline consisting of N points
  7370. * @param {Array} bezierCurve bezierCurve data
  7371. * @param {Number} precision calculation accuracy. Recommended for 1-20. Default = 5
  7372. * @return {Object} Calculation results and related data
  7373. * @return {Array} Option.segmentPoints Point data that constitutes a polyline after calculation
  7374. * @return {Number} Option.cycles Number of iterations
  7375. * @return {Number} Option.rounds The number of recursions for the last iteration
  7376. */
  7377. function abstractBezierCurveToPolyline(bezierCurve) {
  7378. var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
  7379. var segmentsNum = bezierCurve.length - 1;
  7380. var startPoint = bezierCurve[0];
  7381. var endPoint = bezierCurve[segmentsNum][2];
  7382. var segments = bezierCurve.slice(1);
  7383. var getSegmentTPointFuns = segments.map(function (seg, i) {
  7384. var beginPoint = i === 0 ? startPoint : segments[i - 1][2];
  7385. return createGetBezierCurveTPointFun.apply(void 0, [beginPoint].concat((0, _toConsumableArray2["default"])(seg)));
  7386. }); // Initialize the curve to a polyline
  7387. var segmentPointsNum = new Array(segmentsNum).fill(defaultSegmentPointsNum);
  7388. var segmentPoints = getSegmentPointsByNum(getSegmentTPointFuns, segmentPointsNum); // Calculate uniformly distributed points by iteratively
  7389. var result = calcUniformPointsByIteration(segmentPoints, getSegmentTPointFuns, segments, precision);
  7390. result.segmentPoints.push(endPoint);
  7391. return result;
  7392. }
  7393. /**
  7394. * @description Generate a method for obtaining corresponding point by t according to curve data
  7395. * @param {Array} beginPoint BezierCurve begin point. [x, y]
  7396. * @param {Array} controlPoint1 BezierCurve controlPoint1. [x, y]
  7397. * @param {Array} controlPoint2 BezierCurve controlPoint2. [x, y]
  7398. * @param {Array} endPoint BezierCurve end point. [x, y]
  7399. * @return {Function} Expected function
  7400. */
  7401. function createGetBezierCurveTPointFun(beginPoint, controlPoint1, controlPoint2, endPoint) {
  7402. return function (t) {
  7403. var tSubed1 = 1 - t;
  7404. var tSubed1Pow3 = pow(tSubed1, 3);
  7405. var tSubed1Pow2 = pow(tSubed1, 2);
  7406. var tPow3 = pow(t, 3);
  7407. var tPow2 = pow(t, 2);
  7408. return [beginPoint[0] * tSubed1Pow3 + 3 * controlPoint1[0] * t * tSubed1Pow2 + 3 * controlPoint2[0] * tPow2 * tSubed1 + endPoint[0] * tPow3, beginPoint[1] * tSubed1Pow3 + 3 * controlPoint1[1] * t * tSubed1Pow2 + 3 * controlPoint2[1] * tPow2 * tSubed1 + endPoint[1] * tPow3];
  7409. };
  7410. }
  7411. /**
  7412. * @description Get the distance between two points
  7413. * @param {Array} point1 BezierCurve begin point. [x, y]
  7414. * @param {Array} point2 BezierCurve controlPoint1. [x, y]
  7415. * @return {Number} Expected distance
  7416. */
  7417. function getTwoPointDistance(_ref, _ref2) {
  7418. var _ref3 = (0, _slicedToArray2["default"])(_ref, 2),
  7419. ax = _ref3[0],
  7420. ay = _ref3[1];
  7421. var _ref4 = (0, _slicedToArray2["default"])(_ref2, 2),
  7422. bx = _ref4[0],
  7423. by = _ref4[1];
  7424. return sqrt(pow(ax - bx, 2) + pow(ay - by, 2));
  7425. }
  7426. /**
  7427. * @description Get the sum of the array of numbers
  7428. * @param {Array} nums An array of numbers
  7429. * @return {Number} Expected sum
  7430. */
  7431. function getNumsSum(nums) {
  7432. return nums.reduce(function (sum, num) {
  7433. return sum + num;
  7434. }, 0);
  7435. }
  7436. /**
  7437. * @description Get the distance of multiple sets of points
  7438. * @param {Array} segmentPoints Multiple sets of point data
  7439. * @return {Array} Distance of multiple sets of point data
  7440. */
  7441. function getSegmentPointsDistance(segmentPoints) {
  7442. return segmentPoints.map(function (points, i) {
  7443. return new Array(points.length - 1).fill(0).map(function (temp, j) {
  7444. return getTwoPointDistance(points[j], points[j + 1]);
  7445. });
  7446. });
  7447. }
  7448. /**
  7449. * @description Get the distance of multiple sets of points
  7450. * @param {Array} segmentPoints Multiple sets of point data
  7451. * @return {Array} Distance of multiple sets of point data
  7452. */
  7453. function getSegmentPointsByNum(getSegmentTPointFuns, segmentPointsNum) {
  7454. return getSegmentTPointFuns.map(function (getSegmentTPointFun, i) {
  7455. var tGap = 1 / segmentPointsNum[i];
  7456. return new Array(segmentPointsNum[i]).fill('').map(function (foo, j) {
  7457. return getSegmentTPointFun(j * tGap);
  7458. });
  7459. });
  7460. }
  7461. /**
  7462. * @description Get the sum of deviations between line segment and the average length
  7463. * @param {Array} segmentPointsDistance Segment length of polyline
  7464. * @param {Number} avgLength Average length of the line segment
  7465. * @return {Number} Deviations
  7466. */
  7467. function getAllDeviations(segmentPointsDistance, avgLength) {
  7468. return segmentPointsDistance.map(function (seg) {
  7469. return seg.map(function (s) {
  7470. return abs(s - avgLength);
  7471. });
  7472. }).map(function (seg) {
  7473. return getNumsSum(seg);
  7474. }).reduce(function (total, v) {
  7475. return total + v;
  7476. }, 0);
  7477. }
  7478. /**
  7479. * @description Calculate uniformly distributed points by iteratively
  7480. * @param {Array} segmentPoints Multiple setd of points that make up a polyline
  7481. * @param {Array} getSegmentTPointFuns Functions of get a point on the curve with t
  7482. * @param {Array} segments BezierCurve data
  7483. * @param {Number} precision Calculation accuracy
  7484. * @return {Object} Calculation results and related data
  7485. * @return {Array} Option.segmentPoints Point data that constitutes a polyline after calculation
  7486. * @return {Number} Option.cycles Number of iterations
  7487. * @return {Number} Option.rounds The number of recursions for the last iteration
  7488. */
  7489. function calcUniformPointsByIteration(segmentPoints, getSegmentTPointFuns, segments, precision) {
  7490. // The number of loops for the current iteration
  7491. var rounds = 4; // Number of iterations
  7492. var cycles = 1;
  7493. var _loop = function _loop() {
  7494. // Recalculate the number of points per curve based on the last iteration data
  7495. var totalPointsNum = segmentPoints.reduce(function (total, seg) {
  7496. return total + seg.length;
  7497. }, 0); // Add last points of segment to calc exact segment length
  7498. segmentPoints.forEach(function (seg, i) {
  7499. return seg.push(segments[i][2]);
  7500. });
  7501. var segmentPointsDistance = getSegmentPointsDistance(segmentPoints);
  7502. var lineSegmentNum = segmentPointsDistance.reduce(function (total, seg) {
  7503. return total + seg.length;
  7504. }, 0);
  7505. var segmentlength = segmentPointsDistance.map(function (seg) {
  7506. return getNumsSum(seg);
  7507. });
  7508. var totalLength = getNumsSum(segmentlength);
  7509. var avgLength = totalLength / lineSegmentNum; // Check if precision is reached
  7510. var allDeviations = getAllDeviations(segmentPointsDistance, avgLength);
  7511. if (allDeviations <= precision) return "break";
  7512. totalPointsNum = ceil(avgLength / precision * totalPointsNum * 1.1);
  7513. var segmentPointsNum = segmentlength.map(function (length) {
  7514. return ceil(length / totalLength * totalPointsNum);
  7515. }); // Calculate the points after redistribution
  7516. segmentPoints = getSegmentPointsByNum(getSegmentTPointFuns, segmentPointsNum);
  7517. totalPointsNum = segmentPoints.reduce(function (total, seg) {
  7518. return total + seg.length;
  7519. }, 0);
  7520. var segmentPointsForLength = JSON.parse(JSON.stringify(segmentPoints));
  7521. segmentPointsForLength.forEach(function (seg, i) {
  7522. return seg.push(segments[i][2]);
  7523. });
  7524. segmentPointsDistance = getSegmentPointsDistance(segmentPointsForLength);
  7525. lineSegmentNum = segmentPointsDistance.reduce(function (total, seg) {
  7526. return total + seg.length;
  7527. }, 0);
  7528. segmentlength = segmentPointsDistance.map(function (seg) {
  7529. return getNumsSum(seg);
  7530. });
  7531. totalLength = getNumsSum(segmentlength);
  7532. avgLength = totalLength / lineSegmentNum;
  7533. var stepSize = 1 / totalPointsNum / 10; // Recursively for each segment of the polyline
  7534. getSegmentTPointFuns.forEach(function (getSegmentTPointFun, i) {
  7535. var currentSegmentPointsNum = segmentPointsNum[i];
  7536. var t = new Array(currentSegmentPointsNum).fill('').map(function (foo, j) {
  7537. return j / segmentPointsNum[i];
  7538. }); // Repeated recursive offset
  7539. for (var r = 0; r < rounds; r++) {
  7540. var distance = getSegmentPointsDistance([segmentPoints[i]])[0];
  7541. var deviations = distance.map(function (d) {
  7542. return d - avgLength;
  7543. });
  7544. var offset = 0;
  7545. for (var j = 0; j < currentSegmentPointsNum; j++) {
  7546. if (j === 0) return;
  7547. offset += deviations[j - 1];
  7548. t[j] -= stepSize * offset;
  7549. if (t[j] > 1) t[j] = 1;
  7550. if (t[j] < 0) t[j] = 0;
  7551. segmentPoints[i][j] = getSegmentTPointFun(t[j]);
  7552. }
  7553. }
  7554. });
  7555. rounds *= 4;
  7556. cycles++;
  7557. };
  7558. do {
  7559. var _ret = _loop();
  7560. if (_ret === "break") break;
  7561. } while (rounds <= 1025);
  7562. segmentPoints = segmentPoints.reduce(function (all, seg) {
  7563. return all.concat(seg);
  7564. }, []);
  7565. return {
  7566. segmentPoints: segmentPoints,
  7567. cycles: cycles,
  7568. rounds: rounds
  7569. };
  7570. }
  7571. /**
  7572. * @description Get the polyline corresponding to the Bezier curve
  7573. * @param {Array} bezierCurve BezierCurve data
  7574. * @param {Number} precision Calculation accuracy. Recommended for 1-20. Default = 5
  7575. * @return {Array|Boolean} Point data that constitutes a polyline after calculation (Invalid input will return false)
  7576. */
  7577. function bezierCurveToPolyline(bezierCurve) {
  7578. var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
  7579. if (!bezierCurve) {
  7580. console.error('bezierCurveToPolyline: Missing parameters!');
  7581. return false;
  7582. }
  7583. if (!(bezierCurve instanceof Array)) {
  7584. console.error('bezierCurveToPolyline: Parameter bezierCurve must be an array!');
  7585. return false;
  7586. }
  7587. if (typeof precision !== 'number') {
  7588. console.error('bezierCurveToPolyline: Parameter precision must be a number!');
  7589. return false;
  7590. }
  7591. var _abstractBezierCurveT = abstractBezierCurveToPolyline(bezierCurve, precision),
  7592. segmentPoints = _abstractBezierCurveT.segmentPoints;
  7593. return segmentPoints;
  7594. }
  7595. /**
  7596. * @description Get the bezier curve length
  7597. * @param {Array} bezierCurve bezierCurve data
  7598. * @param {Number} precision calculation accuracy. Recommended for 5-10. Default = 5
  7599. * @return {Number|Boolean} BezierCurve length (Invalid input will return false)
  7600. */
  7601. function getBezierCurveLength(bezierCurve) {
  7602. var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
  7603. if (!bezierCurve) {
  7604. console.error('getBezierCurveLength: Missing parameters!');
  7605. return false;
  7606. }
  7607. if (!(bezierCurve instanceof Array)) {
  7608. console.error('getBezierCurveLength: Parameter bezierCurve must be an array!');
  7609. return false;
  7610. }
  7611. if (typeof precision !== 'number') {
  7612. console.error('getBezierCurveLength: Parameter precision must be a number!');
  7613. return false;
  7614. }
  7615. var _abstractBezierCurveT2 = abstractBezierCurveToPolyline(bezierCurve, precision),
  7616. segmentPoints = _abstractBezierCurveT2.segmentPoints; // Calculate the total length of the points that make up the polyline
  7617. var pointsDistance = getSegmentPointsDistance([segmentPoints])[0];
  7618. var length = getNumsSum(pointsDistance);
  7619. return length;
  7620. }
  7621. var _default = bezierCurveToPolyline;
  7622. exports["default"] = _default;
  7623. });
  7624. unwrapExports(bezierCurveToPolyline_1);
  7625. var bezierCurveToPolyline_2 = bezierCurveToPolyline_1.bezierCurveToPolyline;
  7626. var bezierCurveToPolyline_3 = bezierCurveToPolyline_1.getBezierCurveLength;
  7627. var polylineToBezierCurve_1 = createCommonjsModule(function (module, exports) {
  7628. Object.defineProperty(exports, "__esModule", {
  7629. value: true
  7630. });
  7631. exports["default"] = void 0;
  7632. var _slicedToArray2 = interopRequireDefault(slicedToArray);
  7633. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  7634. /**
  7635. * @description Abstract the polyline formed by N points into a set of bezier curve
  7636. * @param {Array} polyline A set of points that make up a polyline
  7637. * @param {Boolean} close Closed curve
  7638. * @param {Number} offsetA Smoothness
  7639. * @param {Number} offsetB Smoothness
  7640. * @return {Array|Boolean} A set of bezier curve (Invalid input will return false)
  7641. */
  7642. function polylineToBezierCurve(polyline) {
  7643. var close = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  7644. var offsetA = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.25;
  7645. var offsetB = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.25;
  7646. if (!(polyline instanceof Array)) {
  7647. console.error('polylineToBezierCurve: Parameter polyline must be an array!');
  7648. return false;
  7649. }
  7650. if (polyline.length <= 2) {
  7651. console.error('polylineToBezierCurve: Converting to a curve requires at least 3 points!');
  7652. return false;
  7653. }
  7654. var startPoint = polyline[0];
  7655. var bezierCurveLineNum = polyline.length - 1;
  7656. var bezierCurvePoints = new Array(bezierCurveLineNum).fill(0).map(function (foo, i) {
  7657. return [].concat((0, _toConsumableArray2["default"])(getBezierCurveLineControlPoints(polyline, i, close, offsetA, offsetB)), [polyline[i + 1]]);
  7658. });
  7659. if (close) closeBezierCurve(bezierCurvePoints, startPoint);
  7660. bezierCurvePoints.unshift(polyline[0]);
  7661. return bezierCurvePoints;
  7662. }
  7663. /**
  7664. * @description Get the control points of the Bezier curve
  7665. * @param {Array} polyline A set of points that make up a polyline
  7666. * @param {Number} index The index of which get controls points's point in polyline
  7667. * @param {Boolean} close Closed curve
  7668. * @param {Number} offsetA Smoothness
  7669. * @param {Number} offsetB Smoothness
  7670. * @return {Array} Control points
  7671. */
  7672. function getBezierCurveLineControlPoints(polyline, index) {
  7673. var close = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  7674. var offsetA = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.25;
  7675. var offsetB = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0.25;
  7676. var pointNum = polyline.length;
  7677. if (pointNum < 3 || index >= pointNum) return;
  7678. var beforePointIndex = index - 1;
  7679. if (beforePointIndex < 0) beforePointIndex = close ? pointNum + beforePointIndex : 0;
  7680. var afterPointIndex = index + 1;
  7681. if (afterPointIndex >= pointNum) afterPointIndex = close ? afterPointIndex - pointNum : pointNum - 1;
  7682. var afterNextPointIndex = index + 2;
  7683. if (afterNextPointIndex >= pointNum) afterNextPointIndex = close ? afterNextPointIndex - pointNum : pointNum - 1;
  7684. var pointBefore = polyline[beforePointIndex];
  7685. var pointMiddle = polyline[index];
  7686. var pointAfter = polyline[afterPointIndex];
  7687. var pointAfterNext = polyline[afterNextPointIndex];
  7688. return [[pointMiddle[0] + offsetA * (pointAfter[0] - pointBefore[0]), pointMiddle[1] + offsetA * (pointAfter[1] - pointBefore[1])], [pointAfter[0] - offsetB * (pointAfterNext[0] - pointMiddle[0]), pointAfter[1] - offsetB * (pointAfterNext[1] - pointMiddle[1])]];
  7689. }
  7690. /**
  7691. * @description Get the last curve of the closure
  7692. * @param {Array} bezierCurve A set of sub-curve
  7693. * @param {Array} startPoint Start point
  7694. * @return {Array} The last curve for closure
  7695. */
  7696. function closeBezierCurve(bezierCurve, startPoint) {
  7697. var firstSubCurve = bezierCurve[0];
  7698. var lastSubCurve = bezierCurve.slice(-1)[0];
  7699. bezierCurve.push([getSymmetryPoint(lastSubCurve[1], lastSubCurve[2]), getSymmetryPoint(firstSubCurve[0], startPoint), startPoint]);
  7700. return bezierCurve;
  7701. }
  7702. /**
  7703. * @description Get the symmetry point
  7704. * @param {Array} point Symmetric point
  7705. * @param {Array} centerPoint Symmetric center
  7706. * @return {Array} Symmetric point
  7707. */
  7708. function getSymmetryPoint(point, centerPoint) {
  7709. var _point = (0, _slicedToArray2["default"])(point, 2),
  7710. px = _point[0],
  7711. py = _point[1];
  7712. var _centerPoint = (0, _slicedToArray2["default"])(centerPoint, 2),
  7713. cx = _centerPoint[0],
  7714. cy = _centerPoint[1];
  7715. var minusX = cx - px;
  7716. var minusY = cy - py;
  7717. return [cx + minusX, cy + minusY];
  7718. }
  7719. var _default = polylineToBezierCurve;
  7720. exports["default"] = _default;
  7721. });
  7722. unwrapExports(polylineToBezierCurve_1);
  7723. var lib$1 = createCommonjsModule(function (module, exports) {
  7724. Object.defineProperty(exports, "__esModule", {
  7725. value: true
  7726. });
  7727. Object.defineProperty(exports, "bezierCurveToPolyline", {
  7728. enumerable: true,
  7729. get: function get() {
  7730. return bezierCurveToPolyline_1.bezierCurveToPolyline;
  7731. }
  7732. });
  7733. Object.defineProperty(exports, "getBezierCurveLength", {
  7734. enumerable: true,
  7735. get: function get() {
  7736. return bezierCurveToPolyline_1.getBezierCurveLength;
  7737. }
  7738. });
  7739. Object.defineProperty(exports, "polylineToBezierCurve", {
  7740. enumerable: true,
  7741. get: function get() {
  7742. return _polylineToBezierCurve["default"];
  7743. }
  7744. });
  7745. exports["default"] = void 0;
  7746. var _polylineToBezierCurve = interopRequireDefault(polylineToBezierCurve_1);
  7747. var _default = {
  7748. bezierCurveToPolyline: bezierCurveToPolyline_1.bezierCurveToPolyline,
  7749. getBezierCurveLength: bezierCurveToPolyline_1.getBezierCurveLength,
  7750. polylineToBezierCurve: _polylineToBezierCurve["default"]
  7751. };
  7752. exports["default"] = _default;
  7753. });
  7754. unwrapExports(lib$1);
  7755. var canvas = createCommonjsModule(function (module, exports) {
  7756. Object.defineProperty(exports, "__esModule", {
  7757. value: true
  7758. });
  7759. exports.drawPolylinePath = drawPolylinePath;
  7760. exports.drawBezierCurvePath = drawBezierCurvePath;
  7761. exports["default"] = void 0;
  7762. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  7763. /**
  7764. * @description Draw a polyline path
  7765. * @param {Object} ctx Canvas 2d context
  7766. * @param {Array} points The points that makes up a polyline
  7767. * @param {Boolean} beginPath Whether to execute beginPath
  7768. * @param {Boolean} closePath Whether to execute closePath
  7769. * @return {Undefined} Void
  7770. */
  7771. function drawPolylinePath(ctx, points) {
  7772. var beginPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  7773. var closePath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  7774. if (!ctx || points.length < 2) return false;
  7775. if (beginPath) ctx.beginPath();
  7776. points.forEach(function (point, i) {
  7777. return point && (i === 0 ? ctx.moveTo.apply(ctx, (0, _toConsumableArray2["default"])(point)) : ctx.lineTo.apply(ctx, (0, _toConsumableArray2["default"])(point)));
  7778. });
  7779. if (closePath) ctx.closePath();
  7780. }
  7781. /**
  7782. * @description Draw a bezier curve path
  7783. * @param {Object} ctx Canvas 2d context
  7784. * @param {Array} points The points that makes up a bezier curve
  7785. * @param {Array} moveTo The point need to excute moveTo
  7786. * @param {Boolean} beginPath Whether to execute beginPath
  7787. * @param {Boolean} closePath Whether to execute closePath
  7788. * @return {Undefined} Void
  7789. */
  7790. function drawBezierCurvePath(ctx, points) {
  7791. var moveTo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  7792. var beginPath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  7793. var closePath = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  7794. if (!ctx || !points) return false;
  7795. if (beginPath) ctx.beginPath();
  7796. if (moveTo) ctx.moveTo.apply(ctx, (0, _toConsumableArray2["default"])(moveTo));
  7797. points.forEach(function (item) {
  7798. return item && ctx.bezierCurveTo.apply(ctx, (0, _toConsumableArray2["default"])(item[0]).concat((0, _toConsumableArray2["default"])(item[1]), (0, _toConsumableArray2["default"])(item[2])));
  7799. });
  7800. if (closePath) ctx.closePath();
  7801. }
  7802. var _default = {
  7803. drawPolylinePath: drawPolylinePath,
  7804. drawBezierCurvePath: drawBezierCurvePath
  7805. };
  7806. exports["default"] = _default;
  7807. });
  7808. unwrapExports(canvas);
  7809. var canvas_1 = canvas.drawPolylinePath;
  7810. var canvas_2 = canvas.drawBezierCurvePath;
  7811. var graphs_1 = createCommonjsModule(function (module, exports) {
  7812. Object.defineProperty(exports, "__esModule", {
  7813. value: true
  7814. });
  7815. exports.extendNewGraph = extendNewGraph;
  7816. exports["default"] = exports.text = exports.bezierCurve = exports.smoothline = exports.polyline = exports.regPolygon = exports.sector = exports.arc = exports.ring = exports.rect = exports.ellipse = exports.circle = void 0;
  7817. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  7818. var _slicedToArray2 = interopRequireDefault(slicedToArray);
  7819. var _bezierCurve2 = interopRequireDefault(lib$1);
  7820. var polylineToBezierCurve = _bezierCurve2["default"].polylineToBezierCurve,
  7821. bezierCurveToPolyline = _bezierCurve2["default"].bezierCurveToPolyline;
  7822. var circle = {
  7823. shape: {
  7824. rx: 0,
  7825. ry: 0,
  7826. r: 0
  7827. },
  7828. validator: function validator(_ref) {
  7829. var shape = _ref.shape;
  7830. var rx = shape.rx,
  7831. ry = shape.ry,
  7832. r = shape.r;
  7833. if (typeof rx !== 'number' || typeof ry !== 'number' || typeof r !== 'number') {
  7834. console.error('Circle shape configuration is abnormal!');
  7835. return false;
  7836. }
  7837. return true;
  7838. },
  7839. draw: function draw(_ref2, _ref3) {
  7840. var ctx = _ref2.ctx;
  7841. var shape = _ref3.shape;
  7842. ctx.beginPath();
  7843. var rx = shape.rx,
  7844. ry = shape.ry,
  7845. r = shape.r;
  7846. ctx.arc(rx, ry, r > 0 ? r : 0.01, 0, Math.PI * 2);
  7847. ctx.fill();
  7848. ctx.stroke();
  7849. ctx.closePath();
  7850. },
  7851. hoverCheck: function hoverCheck(position, _ref4) {
  7852. var shape = _ref4.shape;
  7853. var rx = shape.rx,
  7854. ry = shape.ry,
  7855. r = shape.r;
  7856. return (0, util.checkPointIsInCircle)(position, rx, ry, r);
  7857. },
  7858. setGraphCenter: function setGraphCenter(e, _ref5) {
  7859. var shape = _ref5.shape,
  7860. style = _ref5.style;
  7861. var rx = shape.rx,
  7862. ry = shape.ry;
  7863. style.graphCenter = [rx, ry];
  7864. },
  7865. move: function move(_ref6, _ref7) {
  7866. var movementX = _ref6.movementX,
  7867. movementY = _ref6.movementY;
  7868. var shape = _ref7.shape;
  7869. this.attr('shape', {
  7870. rx: shape.rx + movementX,
  7871. ry: shape.ry + movementY
  7872. });
  7873. }
  7874. };
  7875. exports.circle = circle;
  7876. var ellipse = {
  7877. shape: {
  7878. rx: 0,
  7879. ry: 0,
  7880. hr: 0,
  7881. vr: 0
  7882. },
  7883. validator: function validator(_ref8) {
  7884. var shape = _ref8.shape;
  7885. var rx = shape.rx,
  7886. ry = shape.ry,
  7887. hr = shape.hr,
  7888. vr = shape.vr;
  7889. if (typeof rx !== 'number' || typeof ry !== 'number' || typeof hr !== 'number' || typeof vr !== 'number') {
  7890. console.error('Ellipse shape configuration is abnormal!');
  7891. return false;
  7892. }
  7893. return true;
  7894. },
  7895. draw: function draw(_ref9, _ref10) {
  7896. var ctx = _ref9.ctx;
  7897. var shape = _ref10.shape;
  7898. ctx.beginPath();
  7899. var rx = shape.rx,
  7900. ry = shape.ry,
  7901. hr = shape.hr,
  7902. vr = shape.vr;
  7903. ctx.ellipse(rx, ry, hr > 0 ? hr : 0.01, vr > 0 ? vr : 0.01, 0, 0, Math.PI * 2);
  7904. ctx.fill();
  7905. ctx.stroke();
  7906. ctx.closePath();
  7907. },
  7908. hoverCheck: function hoverCheck(position, _ref11) {
  7909. var shape = _ref11.shape;
  7910. var rx = shape.rx,
  7911. ry = shape.ry,
  7912. hr = shape.hr,
  7913. vr = shape.vr;
  7914. var a = Math.max(hr, vr);
  7915. var b = Math.min(hr, vr);
  7916. var c = Math.sqrt(a * a - b * b);
  7917. var leftFocusPoint = [rx - c, ry];
  7918. var rightFocusPoint = [rx + c, ry];
  7919. var distance = (0, util.getTwoPointDistance)(position, leftFocusPoint) + (0, util.getTwoPointDistance)(position, rightFocusPoint);
  7920. return distance <= 2 * a;
  7921. },
  7922. setGraphCenter: function setGraphCenter(e, _ref12) {
  7923. var shape = _ref12.shape,
  7924. style = _ref12.style;
  7925. var rx = shape.rx,
  7926. ry = shape.ry;
  7927. style.graphCenter = [rx, ry];
  7928. },
  7929. move: function move(_ref13, _ref14) {
  7930. var movementX = _ref13.movementX,
  7931. movementY = _ref13.movementY;
  7932. var shape = _ref14.shape;
  7933. this.attr('shape', {
  7934. rx: shape.rx + movementX,
  7935. ry: shape.ry + movementY
  7936. });
  7937. }
  7938. };
  7939. exports.ellipse = ellipse;
  7940. var rect = {
  7941. shape: {
  7942. x: 0,
  7943. y: 0,
  7944. w: 0,
  7945. h: 0
  7946. },
  7947. validator: function validator(_ref15) {
  7948. var shape = _ref15.shape;
  7949. var x = shape.x,
  7950. y = shape.y,
  7951. w = shape.w,
  7952. h = shape.h;
  7953. if (typeof x !== 'number' || typeof y !== 'number' || typeof w !== 'number' || typeof h !== 'number') {
  7954. console.error('Rect shape configuration is abnormal!');
  7955. return false;
  7956. }
  7957. return true;
  7958. },
  7959. draw: function draw(_ref16, _ref17) {
  7960. var ctx = _ref16.ctx;
  7961. var shape = _ref17.shape;
  7962. ctx.beginPath();
  7963. var x = shape.x,
  7964. y = shape.y,
  7965. w = shape.w,
  7966. h = shape.h;
  7967. ctx.rect(x, y, w, h);
  7968. ctx.fill();
  7969. ctx.stroke();
  7970. ctx.closePath();
  7971. },
  7972. hoverCheck: function hoverCheck(position, _ref18) {
  7973. var shape = _ref18.shape;
  7974. var x = shape.x,
  7975. y = shape.y,
  7976. w = shape.w,
  7977. h = shape.h;
  7978. return (0, util.checkPointIsInRect)(position, x, y, w, h);
  7979. },
  7980. setGraphCenter: function setGraphCenter(e, _ref19) {
  7981. var shape = _ref19.shape,
  7982. style = _ref19.style;
  7983. var x = shape.x,
  7984. y = shape.y,
  7985. w = shape.w,
  7986. h = shape.h;
  7987. style.graphCenter = [x + w / 2, y + h / 2];
  7988. },
  7989. move: function move(_ref20, _ref21) {
  7990. var movementX = _ref20.movementX,
  7991. movementY = _ref20.movementY;
  7992. var shape = _ref21.shape;
  7993. this.attr('shape', {
  7994. x: shape.x + movementX,
  7995. y: shape.y + movementY
  7996. });
  7997. }
  7998. };
  7999. exports.rect = rect;
  8000. var ring = {
  8001. shape: {
  8002. rx: 0,
  8003. ry: 0,
  8004. r: 0
  8005. },
  8006. validator: function validator(_ref22) {
  8007. var shape = _ref22.shape;
  8008. var rx = shape.rx,
  8009. ry = shape.ry,
  8010. r = shape.r;
  8011. if (typeof rx !== 'number' || typeof ry !== 'number' || typeof r !== 'number') {
  8012. console.error('Ring shape configuration is abnormal!');
  8013. return false;
  8014. }
  8015. return true;
  8016. },
  8017. draw: function draw(_ref23, _ref24) {
  8018. var ctx = _ref23.ctx;
  8019. var shape = _ref24.shape;
  8020. ctx.beginPath();
  8021. var rx = shape.rx,
  8022. ry = shape.ry,
  8023. r = shape.r;
  8024. ctx.arc(rx, ry, r > 0 ? r : 0.01, 0, Math.PI * 2);
  8025. ctx.stroke();
  8026. ctx.closePath();
  8027. },
  8028. hoverCheck: function hoverCheck(position, _ref25) {
  8029. var shape = _ref25.shape,
  8030. style = _ref25.style;
  8031. var rx = shape.rx,
  8032. ry = shape.ry,
  8033. r = shape.r;
  8034. var lineWidth = style.lineWidth;
  8035. var halfLineWidth = lineWidth / 2;
  8036. var minDistance = r - halfLineWidth;
  8037. var maxDistance = r + halfLineWidth;
  8038. var distance = (0, util.getTwoPointDistance)(position, [rx, ry]);
  8039. return distance >= minDistance && distance <= maxDistance;
  8040. },
  8041. setGraphCenter: function setGraphCenter(e, _ref26) {
  8042. var shape = _ref26.shape,
  8043. style = _ref26.style;
  8044. var rx = shape.rx,
  8045. ry = shape.ry;
  8046. style.graphCenter = [rx, ry];
  8047. },
  8048. move: function move(_ref27, _ref28) {
  8049. var movementX = _ref27.movementX,
  8050. movementY = _ref27.movementY;
  8051. var shape = _ref28.shape;
  8052. this.attr('shape', {
  8053. rx: shape.rx + movementX,
  8054. ry: shape.ry + movementY
  8055. });
  8056. }
  8057. };
  8058. exports.ring = ring;
  8059. var arc = {
  8060. shape: {
  8061. rx: 0,
  8062. ry: 0,
  8063. r: 0,
  8064. startAngle: 0,
  8065. endAngle: 0,
  8066. clockWise: true
  8067. },
  8068. validator: function validator(_ref29) {
  8069. var shape = _ref29.shape;
  8070. var keys = ['rx', 'ry', 'r', 'startAngle', 'endAngle'];
  8071. if (keys.find(function (key) {
  8072. return typeof shape[key] !== 'number';
  8073. })) {
  8074. console.error('Arc shape configuration is abnormal!');
  8075. return false;
  8076. }
  8077. return true;
  8078. },
  8079. draw: function draw(_ref30, _ref31) {
  8080. var ctx = _ref30.ctx;
  8081. var shape = _ref31.shape;
  8082. ctx.beginPath();
  8083. var rx = shape.rx,
  8084. ry = shape.ry,
  8085. r = shape.r,
  8086. startAngle = shape.startAngle,
  8087. endAngle = shape.endAngle,
  8088. clockWise = shape.clockWise;
  8089. ctx.arc(rx, ry, r > 0 ? r : 0.001, startAngle, endAngle, !clockWise);
  8090. ctx.stroke();
  8091. ctx.closePath();
  8092. },
  8093. hoverCheck: function hoverCheck(position, _ref32) {
  8094. var shape = _ref32.shape,
  8095. style = _ref32.style;
  8096. var rx = shape.rx,
  8097. ry = shape.ry,
  8098. r = shape.r,
  8099. startAngle = shape.startAngle,
  8100. endAngle = shape.endAngle,
  8101. clockWise = shape.clockWise;
  8102. var lineWidth = style.lineWidth;
  8103. var halfLineWidth = lineWidth / 2;
  8104. var insideRadius = r - halfLineWidth;
  8105. var outsideRadius = r + halfLineWidth;
  8106. return !(0, util.checkPointIsInSector)(position, rx, ry, insideRadius, startAngle, endAngle, clockWise) && (0, util.checkPointIsInSector)(position, rx, ry, outsideRadius, startAngle, endAngle, clockWise);
  8107. },
  8108. setGraphCenter: function setGraphCenter(e, _ref33) {
  8109. var shape = _ref33.shape,
  8110. style = _ref33.style;
  8111. var rx = shape.rx,
  8112. ry = shape.ry;
  8113. style.graphCenter = [rx, ry];
  8114. },
  8115. move: function move(_ref34, _ref35) {
  8116. var movementX = _ref34.movementX,
  8117. movementY = _ref34.movementY;
  8118. var shape = _ref35.shape;
  8119. this.attr('shape', {
  8120. rx: shape.rx + movementX,
  8121. ry: shape.ry + movementY
  8122. });
  8123. }
  8124. };
  8125. exports.arc = arc;
  8126. var sector = {
  8127. shape: {
  8128. rx: 0,
  8129. ry: 0,
  8130. r: 0,
  8131. startAngle: 0,
  8132. endAngle: 0,
  8133. clockWise: true
  8134. },
  8135. validator: function validator(_ref36) {
  8136. var shape = _ref36.shape;
  8137. var keys = ['rx', 'ry', 'r', 'startAngle', 'endAngle'];
  8138. if (keys.find(function (key) {
  8139. return typeof shape[key] !== 'number';
  8140. })) {
  8141. console.error('Sector shape configuration is abnormal!');
  8142. return false;
  8143. }
  8144. return true;
  8145. },
  8146. draw: function draw(_ref37, _ref38) {
  8147. var ctx = _ref37.ctx;
  8148. var shape = _ref38.shape;
  8149. ctx.beginPath();
  8150. var rx = shape.rx,
  8151. ry = shape.ry,
  8152. r = shape.r,
  8153. startAngle = shape.startAngle,
  8154. endAngle = shape.endAngle,
  8155. clockWise = shape.clockWise;
  8156. ctx.arc(rx, ry, r > 0 ? r : 0.01, startAngle, endAngle, !clockWise);
  8157. ctx.lineTo(rx, ry);
  8158. ctx.closePath();
  8159. ctx.stroke();
  8160. ctx.fill();
  8161. },
  8162. hoverCheck: function hoverCheck(position, _ref39) {
  8163. var shape = _ref39.shape;
  8164. var rx = shape.rx,
  8165. ry = shape.ry,
  8166. r = shape.r,
  8167. startAngle = shape.startAngle,
  8168. endAngle = shape.endAngle,
  8169. clockWise = shape.clockWise;
  8170. return (0, util.checkPointIsInSector)(position, rx, ry, r, startAngle, endAngle, clockWise);
  8171. },
  8172. setGraphCenter: function setGraphCenter(e, _ref40) {
  8173. var shape = _ref40.shape,
  8174. style = _ref40.style;
  8175. var rx = shape.rx,
  8176. ry = shape.ry;
  8177. style.graphCenter = [rx, ry];
  8178. },
  8179. move: function move(_ref41, _ref42) {
  8180. var movementX = _ref41.movementX,
  8181. movementY = _ref41.movementY;
  8182. var shape = _ref42.shape;
  8183. var rx = shape.rx,
  8184. ry = shape.ry;
  8185. this.attr('shape', {
  8186. rx: rx + movementX,
  8187. ry: ry + movementY
  8188. });
  8189. }
  8190. };
  8191. exports.sector = sector;
  8192. var regPolygon = {
  8193. shape: {
  8194. rx: 0,
  8195. ry: 0,
  8196. r: 0,
  8197. side: 0
  8198. },
  8199. validator: function validator(_ref43) {
  8200. var shape = _ref43.shape;
  8201. var side = shape.side;
  8202. var keys = ['rx', 'ry', 'r', 'side'];
  8203. if (keys.find(function (key) {
  8204. return typeof shape[key] !== 'number';
  8205. })) {
  8206. console.error('RegPolygon shape configuration is abnormal!');
  8207. return false;
  8208. }
  8209. if (side < 3) {
  8210. console.error('RegPolygon at least trigon!');
  8211. return false;
  8212. }
  8213. return true;
  8214. },
  8215. draw: function draw(_ref44, _ref45) {
  8216. var ctx = _ref44.ctx;
  8217. var shape = _ref45.shape,
  8218. cache = _ref45.cache;
  8219. ctx.beginPath();
  8220. var rx = shape.rx,
  8221. ry = shape.ry,
  8222. r = shape.r,
  8223. side = shape.side;
  8224. if (!cache.points || cache.rx !== rx || cache.ry !== ry || cache.r !== r || cache.side !== side) {
  8225. var _points = (0, util.getRegularPolygonPoints)(rx, ry, r, side);
  8226. Object.assign(cache, {
  8227. points: _points,
  8228. rx: rx,
  8229. ry: ry,
  8230. r: r,
  8231. side: side
  8232. });
  8233. }
  8234. var points = cache.points;
  8235. (0, canvas.drawPolylinePath)(ctx, points);
  8236. ctx.closePath();
  8237. ctx.stroke();
  8238. ctx.fill();
  8239. },
  8240. hoverCheck: function hoverCheck(position, _ref46) {
  8241. var cache = _ref46.cache;
  8242. var points = cache.points;
  8243. return (0, util.checkPointIsInPolygon)(position, points);
  8244. },
  8245. setGraphCenter: function setGraphCenter(e, _ref47) {
  8246. var shape = _ref47.shape,
  8247. style = _ref47.style;
  8248. var rx = shape.rx,
  8249. ry = shape.ry;
  8250. style.graphCenter = [rx, ry];
  8251. },
  8252. move: function move(_ref48, _ref49) {
  8253. var movementX = _ref48.movementX,
  8254. movementY = _ref48.movementY;
  8255. var shape = _ref49.shape,
  8256. cache = _ref49.cache;
  8257. var rx = shape.rx,
  8258. ry = shape.ry;
  8259. cache.rx += movementX;
  8260. cache.ry += movementY;
  8261. this.attr('shape', {
  8262. rx: rx + movementX,
  8263. ry: ry + movementY
  8264. });
  8265. cache.points = cache.points.map(function (_ref50) {
  8266. var _ref51 = (0, _slicedToArray2["default"])(_ref50, 2),
  8267. x = _ref51[0],
  8268. y = _ref51[1];
  8269. return [x + movementX, y + movementY];
  8270. });
  8271. }
  8272. };
  8273. exports.regPolygon = regPolygon;
  8274. var polyline = {
  8275. shape: {
  8276. points: [],
  8277. close: false
  8278. },
  8279. validator: function validator(_ref52) {
  8280. var shape = _ref52.shape;
  8281. var points = shape.points;
  8282. if (!(points instanceof Array)) {
  8283. console.error('Polyline points should be an array!');
  8284. return false;
  8285. }
  8286. return true;
  8287. },
  8288. draw: function draw(_ref53, _ref54) {
  8289. var ctx = _ref53.ctx;
  8290. var shape = _ref54.shape,
  8291. lineWidth = _ref54.style.lineWidth;
  8292. ctx.beginPath();
  8293. var points = shape.points,
  8294. close = shape.close;
  8295. if (lineWidth === 1) points = (0, util.eliminateBlur)(points);
  8296. (0, canvas.drawPolylinePath)(ctx, points);
  8297. if (close) {
  8298. ctx.closePath();
  8299. ctx.fill();
  8300. ctx.stroke();
  8301. } else {
  8302. ctx.stroke();
  8303. }
  8304. },
  8305. hoverCheck: function hoverCheck(position, _ref55) {
  8306. var shape = _ref55.shape,
  8307. style = _ref55.style;
  8308. var points = shape.points,
  8309. close = shape.close;
  8310. var lineWidth = style.lineWidth;
  8311. if (close) {
  8312. return (0, util.checkPointIsInPolygon)(position, points);
  8313. } else {
  8314. return (0, util.checkPointIsNearPolyline)(position, points, lineWidth);
  8315. }
  8316. },
  8317. setGraphCenter: function setGraphCenter(e, _ref56) {
  8318. var shape = _ref56.shape,
  8319. style = _ref56.style;
  8320. var points = shape.points;
  8321. style.graphCenter = points[0];
  8322. },
  8323. move: function move(_ref57, _ref58) {
  8324. var movementX = _ref57.movementX,
  8325. movementY = _ref57.movementY;
  8326. var shape = _ref58.shape;
  8327. var points = shape.points;
  8328. var moveAfterPoints = points.map(function (_ref59) {
  8329. var _ref60 = (0, _slicedToArray2["default"])(_ref59, 2),
  8330. x = _ref60[0],
  8331. y = _ref60[1];
  8332. return [x + movementX, y + movementY];
  8333. });
  8334. this.attr('shape', {
  8335. points: moveAfterPoints
  8336. });
  8337. }
  8338. };
  8339. exports.polyline = polyline;
  8340. var smoothline = {
  8341. shape: {
  8342. points: [],
  8343. close: false
  8344. },
  8345. validator: function validator(_ref61) {
  8346. var shape = _ref61.shape;
  8347. var points = shape.points;
  8348. if (!(points instanceof Array)) {
  8349. console.error('Smoothline points should be an array!');
  8350. return false;
  8351. }
  8352. return true;
  8353. },
  8354. draw: function draw(_ref62, _ref63) {
  8355. var ctx = _ref62.ctx;
  8356. var shape = _ref63.shape,
  8357. cache = _ref63.cache;
  8358. var points = shape.points,
  8359. close = shape.close;
  8360. if (!cache.points || cache.points.toString() !== points.toString()) {
  8361. var _bezierCurve = polylineToBezierCurve(points, close);
  8362. var hoverPoints = bezierCurveToPolyline(_bezierCurve);
  8363. Object.assign(cache, {
  8364. points: (0, util.deepClone)(points, true),
  8365. bezierCurve: _bezierCurve,
  8366. hoverPoints: hoverPoints
  8367. });
  8368. }
  8369. var bezierCurve = cache.bezierCurve;
  8370. ctx.beginPath();
  8371. (0, canvas.drawBezierCurvePath)(ctx, bezierCurve.slice(1), bezierCurve[0]);
  8372. if (close) {
  8373. ctx.closePath();
  8374. ctx.fill();
  8375. ctx.stroke();
  8376. } else {
  8377. ctx.stroke();
  8378. }
  8379. },
  8380. hoverCheck: function hoverCheck(position, _ref64) {
  8381. var cache = _ref64.cache,
  8382. shape = _ref64.shape,
  8383. style = _ref64.style;
  8384. var hoverPoints = cache.hoverPoints;
  8385. var close = shape.close;
  8386. var lineWidth = style.lineWidth;
  8387. if (close) {
  8388. return (0, util.checkPointIsInPolygon)(position, hoverPoints);
  8389. } else {
  8390. return (0, util.checkPointIsNearPolyline)(position, hoverPoints, lineWidth);
  8391. }
  8392. },
  8393. setGraphCenter: function setGraphCenter(e, _ref65) {
  8394. var shape = _ref65.shape,
  8395. style = _ref65.style;
  8396. var points = shape.points;
  8397. style.graphCenter = points[0];
  8398. },
  8399. move: function move(_ref66, _ref67) {
  8400. var movementX = _ref66.movementX,
  8401. movementY = _ref66.movementY;
  8402. var shape = _ref67.shape,
  8403. cache = _ref67.cache;
  8404. var points = shape.points;
  8405. var moveAfterPoints = points.map(function (_ref68) {
  8406. var _ref69 = (0, _slicedToArray2["default"])(_ref68, 2),
  8407. x = _ref69[0],
  8408. y = _ref69[1];
  8409. return [x + movementX, y + movementY];
  8410. });
  8411. cache.points = moveAfterPoints;
  8412. var _cache$bezierCurve$ = (0, _slicedToArray2["default"])(cache.bezierCurve[0], 2),
  8413. fx = _cache$bezierCurve$[0],
  8414. fy = _cache$bezierCurve$[1];
  8415. var curves = cache.bezierCurve.slice(1);
  8416. cache.bezierCurve = [[fx + movementX, fy + movementY]].concat((0, _toConsumableArray2["default"])(curves.map(function (curve) {
  8417. return curve.map(function (_ref70) {
  8418. var _ref71 = (0, _slicedToArray2["default"])(_ref70, 2),
  8419. x = _ref71[0],
  8420. y = _ref71[1];
  8421. return [x + movementX, y + movementY];
  8422. });
  8423. })));
  8424. cache.hoverPoints = cache.hoverPoints.map(function (_ref72) {
  8425. var _ref73 = (0, _slicedToArray2["default"])(_ref72, 2),
  8426. x = _ref73[0],
  8427. y = _ref73[1];
  8428. return [x + movementX, y + movementY];
  8429. });
  8430. this.attr('shape', {
  8431. points: moveAfterPoints
  8432. });
  8433. }
  8434. };
  8435. exports.smoothline = smoothline;
  8436. var bezierCurve = {
  8437. shape: {
  8438. points: [],
  8439. close: false
  8440. },
  8441. validator: function validator(_ref74) {
  8442. var shape = _ref74.shape;
  8443. var points = shape.points;
  8444. if (!(points instanceof Array)) {
  8445. console.error('BezierCurve points should be an array!');
  8446. return false;
  8447. }
  8448. return true;
  8449. },
  8450. draw: function draw(_ref75, _ref76) {
  8451. var ctx = _ref75.ctx;
  8452. var shape = _ref76.shape,
  8453. cache = _ref76.cache;
  8454. var points = shape.points,
  8455. close = shape.close;
  8456. if (!cache.points || cache.points.toString() !== points.toString()) {
  8457. var hoverPoints = bezierCurveToPolyline(points, 20);
  8458. Object.assign(cache, {
  8459. points: (0, util.deepClone)(points, true),
  8460. hoverPoints: hoverPoints
  8461. });
  8462. }
  8463. ctx.beginPath();
  8464. (0, canvas.drawBezierCurvePath)(ctx, points.slice(1), points[0]);
  8465. if (close) {
  8466. ctx.closePath();
  8467. ctx.fill();
  8468. ctx.stroke();
  8469. } else {
  8470. ctx.stroke();
  8471. }
  8472. },
  8473. hoverCheck: function hoverCheck(position, _ref77) {
  8474. var cache = _ref77.cache,
  8475. shape = _ref77.shape,
  8476. style = _ref77.style;
  8477. var hoverPoints = cache.hoverPoints;
  8478. var close = shape.close;
  8479. var lineWidth = style.lineWidth;
  8480. if (close) {
  8481. return (0, util.checkPointIsInPolygon)(position, hoverPoints);
  8482. } else {
  8483. return (0, util.checkPointIsNearPolyline)(position, hoverPoints, lineWidth);
  8484. }
  8485. },
  8486. setGraphCenter: function setGraphCenter(e, _ref78) {
  8487. var shape = _ref78.shape,
  8488. style = _ref78.style;
  8489. var points = shape.points;
  8490. style.graphCenter = points[0];
  8491. },
  8492. move: function move(_ref79, _ref80) {
  8493. var movementX = _ref79.movementX,
  8494. movementY = _ref79.movementY;
  8495. var shape = _ref80.shape,
  8496. cache = _ref80.cache;
  8497. var points = shape.points;
  8498. var _points$ = (0, _slicedToArray2["default"])(points[0], 2),
  8499. fx = _points$[0],
  8500. fy = _points$[1];
  8501. var curves = points.slice(1);
  8502. var bezierCurve = [[fx + movementX, fy + movementY]].concat((0, _toConsumableArray2["default"])(curves.map(function (curve) {
  8503. return curve.map(function (_ref81) {
  8504. var _ref82 = (0, _slicedToArray2["default"])(_ref81, 2),
  8505. x = _ref82[0],
  8506. y = _ref82[1];
  8507. return [x + movementX, y + movementY];
  8508. });
  8509. })));
  8510. cache.points = bezierCurve;
  8511. cache.hoverPoints = cache.hoverPoints.map(function (_ref83) {
  8512. var _ref84 = (0, _slicedToArray2["default"])(_ref83, 2),
  8513. x = _ref84[0],
  8514. y = _ref84[1];
  8515. return [x + movementX, y + movementY];
  8516. });
  8517. this.attr('shape', {
  8518. points: bezierCurve
  8519. });
  8520. }
  8521. };
  8522. exports.bezierCurve = bezierCurve;
  8523. var text = {
  8524. shape: {
  8525. content: '',
  8526. position: [],
  8527. maxWidth: undefined,
  8528. rowGap: 0
  8529. },
  8530. validator: function validator(_ref85) {
  8531. var shape = _ref85.shape;
  8532. var content = shape.content,
  8533. position = shape.position,
  8534. rowGap = shape.rowGap;
  8535. if (typeof content !== 'string') {
  8536. console.error('Text content should be a string!');
  8537. return false;
  8538. }
  8539. if (!(position instanceof Array)) {
  8540. console.error('Text position should be an array!');
  8541. return false;
  8542. }
  8543. if (typeof rowGap !== 'number') {
  8544. console.error('Text rowGap should be a number!');
  8545. return false;
  8546. }
  8547. return true;
  8548. },
  8549. draw: function draw(_ref86, _ref87) {
  8550. var ctx = _ref86.ctx;
  8551. var shape = _ref87.shape;
  8552. var content = shape.content,
  8553. position = shape.position,
  8554. maxWidth = shape.maxWidth,
  8555. rowGap = shape.rowGap;
  8556. var textBaseline = ctx.textBaseline,
  8557. font = ctx.font;
  8558. var fontSize = parseInt(font.replace(/\D/g, ''));
  8559. var _position = position,
  8560. _position2 = (0, _slicedToArray2["default"])(_position, 2),
  8561. x = _position2[0],
  8562. y = _position2[1];
  8563. content = content.split('\n');
  8564. var rowNum = content.length;
  8565. var lineHeight = fontSize + rowGap;
  8566. var allHeight = rowNum * lineHeight - rowGap;
  8567. var offset = 0;
  8568. if (textBaseline === 'middle') {
  8569. offset = allHeight / 2;
  8570. y += fontSize / 2;
  8571. }
  8572. if (textBaseline === 'bottom') {
  8573. offset = allHeight;
  8574. y += fontSize;
  8575. }
  8576. position = new Array(rowNum).fill(0).map(function (foo, i) {
  8577. return [x, y + i * lineHeight - offset];
  8578. });
  8579. ctx.beginPath();
  8580. content.forEach(function (text, i) {
  8581. ctx.fillText.apply(ctx, [text].concat((0, _toConsumableArray2["default"])(position[i]), [maxWidth]));
  8582. ctx.strokeText.apply(ctx, [text].concat((0, _toConsumableArray2["default"])(position[i]), [maxWidth]));
  8583. });
  8584. ctx.closePath();
  8585. },
  8586. hoverCheck: function hoverCheck(position, _ref88) {
  8587. var shape = _ref88.shape,
  8588. style = _ref88.style;
  8589. return false;
  8590. },
  8591. setGraphCenter: function setGraphCenter(e, _ref89) {
  8592. var shape = _ref89.shape,
  8593. style = _ref89.style;
  8594. var position = shape.position;
  8595. style.graphCenter = (0, _toConsumableArray2["default"])(position);
  8596. },
  8597. move: function move(_ref90, _ref91) {
  8598. var movementX = _ref90.movementX,
  8599. movementY = _ref90.movementY;
  8600. var shape = _ref91.shape;
  8601. var _shape$position = (0, _slicedToArray2["default"])(shape.position, 2),
  8602. x = _shape$position[0],
  8603. y = _shape$position[1];
  8604. this.attr('shape', {
  8605. position: [x + movementX, y + movementY]
  8606. });
  8607. }
  8608. };
  8609. exports.text = text;
  8610. var graphs = new Map([['circle', circle], ['ellipse', ellipse], ['rect', rect], ['ring', ring], ['arc', arc], ['sector', sector], ['regPolygon', regPolygon], ['polyline', polyline], ['smoothline', smoothline], ['bezierCurve', bezierCurve], ['text', text]]);
  8611. var _default = graphs;
  8612. /**
  8613. * @description Extend new graph
  8614. * @param {String} name Name of Graph
  8615. * @param {Object} config Configuration of Graph
  8616. * @return {Undefined} Void
  8617. */
  8618. exports["default"] = _default;
  8619. function extendNewGraph(name, config) {
  8620. if (!name || !config) {
  8621. console.error('ExtendNewGraph Missing Parameters!');
  8622. return;
  8623. }
  8624. if (!config.shape) {
  8625. console.error('Required attribute of shape to extendNewGraph!');
  8626. return;
  8627. }
  8628. if (!config.validator) {
  8629. console.error('Required function of validator to extendNewGraph!');
  8630. return;
  8631. }
  8632. if (!config.draw) {
  8633. console.error('Required function of draw to extendNewGraph!');
  8634. return;
  8635. }
  8636. graphs.set(name, config);
  8637. }
  8638. });
  8639. unwrapExports(graphs_1);
  8640. var graphs_2 = graphs_1.extendNewGraph;
  8641. var graphs_3 = graphs_1.text;
  8642. var graphs_4 = graphs_1.bezierCurve;
  8643. var graphs_5 = graphs_1.smoothline;
  8644. var graphs_6 = graphs_1.polyline;
  8645. var graphs_7 = graphs_1.regPolygon;
  8646. var graphs_8 = graphs_1.sector;
  8647. var graphs_9 = graphs_1.arc;
  8648. var graphs_10 = graphs_1.ring;
  8649. var graphs_11 = graphs_1.rect;
  8650. var graphs_12 = graphs_1.ellipse;
  8651. var graphs_13 = graphs_1.circle;
  8652. var runtime_1 = createCommonjsModule(function (module) {
  8653. /**
  8654. * Copyright (c) 2014-present, Facebook, Inc.
  8655. *
  8656. * This source code is licensed under the MIT license found in the
  8657. * LICENSE file in the root directory of this source tree.
  8658. */
  8659. var runtime = (function (exports) {
  8660. var Op = Object.prototype;
  8661. var hasOwn = Op.hasOwnProperty;
  8662. var undefined$1; // More compressible than void 0.
  8663. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  8664. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  8665. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  8666. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  8667. function wrap(innerFn, outerFn, self, tryLocsList) {
  8668. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  8669. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  8670. var generator = Object.create(protoGenerator.prototype);
  8671. var context = new Context(tryLocsList || []);
  8672. // The ._invoke method unifies the implementations of the .next,
  8673. // .throw, and .return methods.
  8674. generator._invoke = makeInvokeMethod(innerFn, self, context);
  8675. return generator;
  8676. }
  8677. exports.wrap = wrap;
  8678. // Try/catch helper to minimize deoptimizations. Returns a completion
  8679. // record like context.tryEntries[i].completion. This interface could
  8680. // have been (and was previously) designed to take a closure to be
  8681. // invoked without arguments, but in all the cases we care about we
  8682. // already have an existing method we want to call, so there's no need
  8683. // to create a new function object. We can even get away with assuming
  8684. // the method takes exactly one argument, since that happens to be true
  8685. // in every case, so we don't have to touch the arguments object. The
  8686. // only additional allocation required is the completion record, which
  8687. // has a stable shape and so hopefully should be cheap to allocate.
  8688. function tryCatch(fn, obj, arg) {
  8689. try {
  8690. return { type: "normal", arg: fn.call(obj, arg) };
  8691. } catch (err) {
  8692. return { type: "throw", arg: err };
  8693. }
  8694. }
  8695. var GenStateSuspendedStart = "suspendedStart";
  8696. var GenStateSuspendedYield = "suspendedYield";
  8697. var GenStateExecuting = "executing";
  8698. var GenStateCompleted = "completed";
  8699. // Returning this object from the innerFn has the same effect as
  8700. // breaking out of the dispatch switch statement.
  8701. var ContinueSentinel = {};
  8702. // Dummy constructor functions that we use as the .constructor and
  8703. // .constructor.prototype properties for functions that return Generator
  8704. // objects. For full spec compliance, you may wish to configure your
  8705. // minifier not to mangle the names of these two functions.
  8706. function Generator() {}
  8707. function GeneratorFunction() {}
  8708. function GeneratorFunctionPrototype() {}
  8709. // This is a polyfill for %IteratorPrototype% for environments that
  8710. // don't natively support it.
  8711. var IteratorPrototype = {};
  8712. IteratorPrototype[iteratorSymbol] = function () {
  8713. return this;
  8714. };
  8715. var getProto = Object.getPrototypeOf;
  8716. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  8717. if (NativeIteratorPrototype &&
  8718. NativeIteratorPrototype !== Op &&
  8719. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  8720. // This environment has a native %IteratorPrototype%; use it instead
  8721. // of the polyfill.
  8722. IteratorPrototype = NativeIteratorPrototype;
  8723. }
  8724. var Gp = GeneratorFunctionPrototype.prototype =
  8725. Generator.prototype = Object.create(IteratorPrototype);
  8726. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  8727. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  8728. GeneratorFunctionPrototype[toStringTagSymbol] =
  8729. GeneratorFunction.displayName = "GeneratorFunction";
  8730. // Helper for defining the .next, .throw, and .return methods of the
  8731. // Iterator interface in terms of a single ._invoke method.
  8732. function defineIteratorMethods(prototype) {
  8733. ["next", "throw", "return"].forEach(function(method) {
  8734. prototype[method] = function(arg) {
  8735. return this._invoke(method, arg);
  8736. };
  8737. });
  8738. }
  8739. exports.isGeneratorFunction = function(genFun) {
  8740. var ctor = typeof genFun === "function" && genFun.constructor;
  8741. return ctor
  8742. ? ctor === GeneratorFunction ||
  8743. // For the native GeneratorFunction constructor, the best we can
  8744. // do is to check its .name property.
  8745. (ctor.displayName || ctor.name) === "GeneratorFunction"
  8746. : false;
  8747. };
  8748. exports.mark = function(genFun) {
  8749. if (Object.setPrototypeOf) {
  8750. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  8751. } else {
  8752. genFun.__proto__ = GeneratorFunctionPrototype;
  8753. if (!(toStringTagSymbol in genFun)) {
  8754. genFun[toStringTagSymbol] = "GeneratorFunction";
  8755. }
  8756. }
  8757. genFun.prototype = Object.create(Gp);
  8758. return genFun;
  8759. };
  8760. // Within the body of any async function, `await x` is transformed to
  8761. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  8762. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  8763. // meant to be awaited.
  8764. exports.awrap = function(arg) {
  8765. return { __await: arg };
  8766. };
  8767. function AsyncIterator(generator, PromiseImpl) {
  8768. function invoke(method, arg, resolve, reject) {
  8769. var record = tryCatch(generator[method], generator, arg);
  8770. if (record.type === "throw") {
  8771. reject(record.arg);
  8772. } else {
  8773. var result = record.arg;
  8774. var value = result.value;
  8775. if (value &&
  8776. typeof value === "object" &&
  8777. hasOwn.call(value, "__await")) {
  8778. return PromiseImpl.resolve(value.__await).then(function(value) {
  8779. invoke("next", value, resolve, reject);
  8780. }, function(err) {
  8781. invoke("throw", err, resolve, reject);
  8782. });
  8783. }
  8784. return PromiseImpl.resolve(value).then(function(unwrapped) {
  8785. // When a yielded Promise is resolved, its final value becomes
  8786. // the .value of the Promise<{value,done}> result for the
  8787. // current iteration.
  8788. result.value = unwrapped;
  8789. resolve(result);
  8790. }, function(error) {
  8791. // If a rejected Promise was yielded, throw the rejection back
  8792. // into the async generator function so it can be handled there.
  8793. return invoke("throw", error, resolve, reject);
  8794. });
  8795. }
  8796. }
  8797. var previousPromise;
  8798. function enqueue(method, arg) {
  8799. function callInvokeWithMethodAndArg() {
  8800. return new PromiseImpl(function(resolve, reject) {
  8801. invoke(method, arg, resolve, reject);
  8802. });
  8803. }
  8804. return previousPromise =
  8805. // If enqueue has been called before, then we want to wait until
  8806. // all previous Promises have been resolved before calling invoke,
  8807. // so that results are always delivered in the correct order. If
  8808. // enqueue has not been called before, then it is important to
  8809. // call invoke immediately, without waiting on a callback to fire,
  8810. // so that the async generator function has the opportunity to do
  8811. // any necessary setup in a predictable way. This predictability
  8812. // is why the Promise constructor synchronously invokes its
  8813. // executor callback, and why async functions synchronously
  8814. // execute code before the first await. Since we implement simple
  8815. // async functions in terms of async generators, it is especially
  8816. // important to get this right, even though it requires care.
  8817. previousPromise ? previousPromise.then(
  8818. callInvokeWithMethodAndArg,
  8819. // Avoid propagating failures to Promises returned by later
  8820. // invocations of the iterator.
  8821. callInvokeWithMethodAndArg
  8822. ) : callInvokeWithMethodAndArg();
  8823. }
  8824. // Define the unified helper method that is used to implement .next,
  8825. // .throw, and .return (see defineIteratorMethods).
  8826. this._invoke = enqueue;
  8827. }
  8828. defineIteratorMethods(AsyncIterator.prototype);
  8829. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  8830. return this;
  8831. };
  8832. exports.AsyncIterator = AsyncIterator;
  8833. // Note that simple async functions are implemented on top of
  8834. // AsyncIterator objects; they just return a Promise for the value of
  8835. // the final result produced by the iterator.
  8836. exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  8837. if (PromiseImpl === void 0) PromiseImpl = Promise;
  8838. var iter = new AsyncIterator(
  8839. wrap(innerFn, outerFn, self, tryLocsList),
  8840. PromiseImpl
  8841. );
  8842. return exports.isGeneratorFunction(outerFn)
  8843. ? iter // If outerFn is a generator, return the full iterator.
  8844. : iter.next().then(function(result) {
  8845. return result.done ? result.value : iter.next();
  8846. });
  8847. };
  8848. function makeInvokeMethod(innerFn, self, context) {
  8849. var state = GenStateSuspendedStart;
  8850. return function invoke(method, arg) {
  8851. if (state === GenStateExecuting) {
  8852. throw new Error("Generator is already running");
  8853. }
  8854. if (state === GenStateCompleted) {
  8855. if (method === "throw") {
  8856. throw arg;
  8857. }
  8858. // Be forgiving, per 25.3.3.3.3 of the spec:
  8859. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  8860. return doneResult();
  8861. }
  8862. context.method = method;
  8863. context.arg = arg;
  8864. while (true) {
  8865. var delegate = context.delegate;
  8866. if (delegate) {
  8867. var delegateResult = maybeInvokeDelegate(delegate, context);
  8868. if (delegateResult) {
  8869. if (delegateResult === ContinueSentinel) continue;
  8870. return delegateResult;
  8871. }
  8872. }
  8873. if (context.method === "next") {
  8874. // Setting context._sent for legacy support of Babel's
  8875. // function.sent implementation.
  8876. context.sent = context._sent = context.arg;
  8877. } else if (context.method === "throw") {
  8878. if (state === GenStateSuspendedStart) {
  8879. state = GenStateCompleted;
  8880. throw context.arg;
  8881. }
  8882. context.dispatchException(context.arg);
  8883. } else if (context.method === "return") {
  8884. context.abrupt("return", context.arg);
  8885. }
  8886. state = GenStateExecuting;
  8887. var record = tryCatch(innerFn, self, context);
  8888. if (record.type === "normal") {
  8889. // If an exception is thrown from innerFn, we leave state ===
  8890. // GenStateExecuting and loop back for another invocation.
  8891. state = context.done
  8892. ? GenStateCompleted
  8893. : GenStateSuspendedYield;
  8894. if (record.arg === ContinueSentinel) {
  8895. continue;
  8896. }
  8897. return {
  8898. value: record.arg,
  8899. done: context.done
  8900. };
  8901. } else if (record.type === "throw") {
  8902. state = GenStateCompleted;
  8903. // Dispatch the exception by looping back around to the
  8904. // context.dispatchException(context.arg) call above.
  8905. context.method = "throw";
  8906. context.arg = record.arg;
  8907. }
  8908. }
  8909. };
  8910. }
  8911. // Call delegate.iterator[context.method](context.arg) and handle the
  8912. // result, either by returning a { value, done } result from the
  8913. // delegate iterator, or by modifying context.method and context.arg,
  8914. // setting context.delegate to null, and returning the ContinueSentinel.
  8915. function maybeInvokeDelegate(delegate, context) {
  8916. var method = delegate.iterator[context.method];
  8917. if (method === undefined$1) {
  8918. // A .throw or .return when the delegate iterator has no .throw
  8919. // method always terminates the yield* loop.
  8920. context.delegate = null;
  8921. if (context.method === "throw") {
  8922. // Note: ["return"] must be used for ES3 parsing compatibility.
  8923. if (delegate.iterator["return"]) {
  8924. // If the delegate iterator has a return method, give it a
  8925. // chance to clean up.
  8926. context.method = "return";
  8927. context.arg = undefined$1;
  8928. maybeInvokeDelegate(delegate, context);
  8929. if (context.method === "throw") {
  8930. // If maybeInvokeDelegate(context) changed context.method from
  8931. // "return" to "throw", let that override the TypeError below.
  8932. return ContinueSentinel;
  8933. }
  8934. }
  8935. context.method = "throw";
  8936. context.arg = new TypeError(
  8937. "The iterator does not provide a 'throw' method");
  8938. }
  8939. return ContinueSentinel;
  8940. }
  8941. var record = tryCatch(method, delegate.iterator, context.arg);
  8942. if (record.type === "throw") {
  8943. context.method = "throw";
  8944. context.arg = record.arg;
  8945. context.delegate = null;
  8946. return ContinueSentinel;
  8947. }
  8948. var info = record.arg;
  8949. if (! info) {
  8950. context.method = "throw";
  8951. context.arg = new TypeError("iterator result is not an object");
  8952. context.delegate = null;
  8953. return ContinueSentinel;
  8954. }
  8955. if (info.done) {
  8956. // Assign the result of the finished delegate to the temporary
  8957. // variable specified by delegate.resultName (see delegateYield).
  8958. context[delegate.resultName] = info.value;
  8959. // Resume execution at the desired location (see delegateYield).
  8960. context.next = delegate.nextLoc;
  8961. // If context.method was "throw" but the delegate handled the
  8962. // exception, let the outer generator proceed normally. If
  8963. // context.method was "next", forget context.arg since it has been
  8964. // "consumed" by the delegate iterator. If context.method was
  8965. // "return", allow the original .return call to continue in the
  8966. // outer generator.
  8967. if (context.method !== "return") {
  8968. context.method = "next";
  8969. context.arg = undefined$1;
  8970. }
  8971. } else {
  8972. // Re-yield the result returned by the delegate method.
  8973. return info;
  8974. }
  8975. // The delegate iterator is finished, so forget it and continue with
  8976. // the outer generator.
  8977. context.delegate = null;
  8978. return ContinueSentinel;
  8979. }
  8980. // Define Generator.prototype.{next,throw,return} in terms of the
  8981. // unified ._invoke helper method.
  8982. defineIteratorMethods(Gp);
  8983. Gp[toStringTagSymbol] = "Generator";
  8984. // A Generator should always return itself as the iterator object when the
  8985. // @@iterator function is called on it. Some browsers' implementations of the
  8986. // iterator prototype chain incorrectly implement this, causing the Generator
  8987. // object to not be returned from this call. This ensures that doesn't happen.
  8988. // See https://github.com/facebook/regenerator/issues/274 for more details.
  8989. Gp[iteratorSymbol] = function() {
  8990. return this;
  8991. };
  8992. Gp.toString = function() {
  8993. return "[object Generator]";
  8994. };
  8995. function pushTryEntry(locs) {
  8996. var entry = { tryLoc: locs[0] };
  8997. if (1 in locs) {
  8998. entry.catchLoc = locs[1];
  8999. }
  9000. if (2 in locs) {
  9001. entry.finallyLoc = locs[2];
  9002. entry.afterLoc = locs[3];
  9003. }
  9004. this.tryEntries.push(entry);
  9005. }
  9006. function resetTryEntry(entry) {
  9007. var record = entry.completion || {};
  9008. record.type = "normal";
  9009. delete record.arg;
  9010. entry.completion = record;
  9011. }
  9012. function Context(tryLocsList) {
  9013. // The root entry object (effectively a try statement without a catch
  9014. // or a finally block) gives us a place to store values thrown from
  9015. // locations where there is no enclosing try statement.
  9016. this.tryEntries = [{ tryLoc: "root" }];
  9017. tryLocsList.forEach(pushTryEntry, this);
  9018. this.reset(true);
  9019. }
  9020. exports.keys = function(object) {
  9021. var keys = [];
  9022. for (var key in object) {
  9023. keys.push(key);
  9024. }
  9025. keys.reverse();
  9026. // Rather than returning an object with a next method, we keep
  9027. // things simple and return the next function itself.
  9028. return function next() {
  9029. while (keys.length) {
  9030. var key = keys.pop();
  9031. if (key in object) {
  9032. next.value = key;
  9033. next.done = false;
  9034. return next;
  9035. }
  9036. }
  9037. // To avoid creating an additional object, we just hang the .value
  9038. // and .done properties off the next function object itself. This
  9039. // also ensures that the minifier will not anonymize the function.
  9040. next.done = true;
  9041. return next;
  9042. };
  9043. };
  9044. function values(iterable) {
  9045. if (iterable) {
  9046. var iteratorMethod = iterable[iteratorSymbol];
  9047. if (iteratorMethod) {
  9048. return iteratorMethod.call(iterable);
  9049. }
  9050. if (typeof iterable.next === "function") {
  9051. return iterable;
  9052. }
  9053. if (!isNaN(iterable.length)) {
  9054. var i = -1, next = function next() {
  9055. while (++i < iterable.length) {
  9056. if (hasOwn.call(iterable, i)) {
  9057. next.value = iterable[i];
  9058. next.done = false;
  9059. return next;
  9060. }
  9061. }
  9062. next.value = undefined$1;
  9063. next.done = true;
  9064. return next;
  9065. };
  9066. return next.next = next;
  9067. }
  9068. }
  9069. // Return an iterator with no values.
  9070. return { next: doneResult };
  9071. }
  9072. exports.values = values;
  9073. function doneResult() {
  9074. return { value: undefined$1, done: true };
  9075. }
  9076. Context.prototype = {
  9077. constructor: Context,
  9078. reset: function(skipTempReset) {
  9079. this.prev = 0;
  9080. this.next = 0;
  9081. // Resetting context._sent for legacy support of Babel's
  9082. // function.sent implementation.
  9083. this.sent = this._sent = undefined$1;
  9084. this.done = false;
  9085. this.delegate = null;
  9086. this.method = "next";
  9087. this.arg = undefined$1;
  9088. this.tryEntries.forEach(resetTryEntry);
  9089. if (!skipTempReset) {
  9090. for (var name in this) {
  9091. // Not sure about the optimal order of these conditions:
  9092. if (name.charAt(0) === "t" &&
  9093. hasOwn.call(this, name) &&
  9094. !isNaN(+name.slice(1))) {
  9095. this[name] = undefined$1;
  9096. }
  9097. }
  9098. }
  9099. },
  9100. stop: function() {
  9101. this.done = true;
  9102. var rootEntry = this.tryEntries[0];
  9103. var rootRecord = rootEntry.completion;
  9104. if (rootRecord.type === "throw") {
  9105. throw rootRecord.arg;
  9106. }
  9107. return this.rval;
  9108. },
  9109. dispatchException: function(exception) {
  9110. if (this.done) {
  9111. throw exception;
  9112. }
  9113. var context = this;
  9114. function handle(loc, caught) {
  9115. record.type = "throw";
  9116. record.arg = exception;
  9117. context.next = loc;
  9118. if (caught) {
  9119. // If the dispatched exception was caught by a catch block,
  9120. // then let that catch block handle the exception normally.
  9121. context.method = "next";
  9122. context.arg = undefined$1;
  9123. }
  9124. return !! caught;
  9125. }
  9126. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9127. var entry = this.tryEntries[i];
  9128. var record = entry.completion;
  9129. if (entry.tryLoc === "root") {
  9130. // Exception thrown outside of any try block that could handle
  9131. // it, so set the completion value of the entire function to
  9132. // throw the exception.
  9133. return handle("end");
  9134. }
  9135. if (entry.tryLoc <= this.prev) {
  9136. var hasCatch = hasOwn.call(entry, "catchLoc");
  9137. var hasFinally = hasOwn.call(entry, "finallyLoc");
  9138. if (hasCatch && hasFinally) {
  9139. if (this.prev < entry.catchLoc) {
  9140. return handle(entry.catchLoc, true);
  9141. } else if (this.prev < entry.finallyLoc) {
  9142. return handle(entry.finallyLoc);
  9143. }
  9144. } else if (hasCatch) {
  9145. if (this.prev < entry.catchLoc) {
  9146. return handle(entry.catchLoc, true);
  9147. }
  9148. } else if (hasFinally) {
  9149. if (this.prev < entry.finallyLoc) {
  9150. return handle(entry.finallyLoc);
  9151. }
  9152. } else {
  9153. throw new Error("try statement without catch or finally");
  9154. }
  9155. }
  9156. }
  9157. },
  9158. abrupt: function(type, arg) {
  9159. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9160. var entry = this.tryEntries[i];
  9161. if (entry.tryLoc <= this.prev &&
  9162. hasOwn.call(entry, "finallyLoc") &&
  9163. this.prev < entry.finallyLoc) {
  9164. var finallyEntry = entry;
  9165. break;
  9166. }
  9167. }
  9168. if (finallyEntry &&
  9169. (type === "break" ||
  9170. type === "continue") &&
  9171. finallyEntry.tryLoc <= arg &&
  9172. arg <= finallyEntry.finallyLoc) {
  9173. // Ignore the finally entry if control is not jumping to a
  9174. // location outside the try/catch block.
  9175. finallyEntry = null;
  9176. }
  9177. var record = finallyEntry ? finallyEntry.completion : {};
  9178. record.type = type;
  9179. record.arg = arg;
  9180. if (finallyEntry) {
  9181. this.method = "next";
  9182. this.next = finallyEntry.finallyLoc;
  9183. return ContinueSentinel;
  9184. }
  9185. return this.complete(record);
  9186. },
  9187. complete: function(record, afterLoc) {
  9188. if (record.type === "throw") {
  9189. throw record.arg;
  9190. }
  9191. if (record.type === "break" ||
  9192. record.type === "continue") {
  9193. this.next = record.arg;
  9194. } else if (record.type === "return") {
  9195. this.rval = this.arg = record.arg;
  9196. this.method = "return";
  9197. this.next = "end";
  9198. } else if (record.type === "normal" && afterLoc) {
  9199. this.next = afterLoc;
  9200. }
  9201. return ContinueSentinel;
  9202. },
  9203. finish: function(finallyLoc) {
  9204. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9205. var entry = this.tryEntries[i];
  9206. if (entry.finallyLoc === finallyLoc) {
  9207. this.complete(entry.completion, entry.afterLoc);
  9208. resetTryEntry(entry);
  9209. return ContinueSentinel;
  9210. }
  9211. }
  9212. },
  9213. "catch": function(tryLoc) {
  9214. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9215. var entry = this.tryEntries[i];
  9216. if (entry.tryLoc === tryLoc) {
  9217. var record = entry.completion;
  9218. if (record.type === "throw") {
  9219. var thrown = record.arg;
  9220. resetTryEntry(entry);
  9221. }
  9222. return thrown;
  9223. }
  9224. }
  9225. // The context.catch method must only be called with a location
  9226. // argument that corresponds to a known catch block.
  9227. throw new Error("illegal catch attempt");
  9228. },
  9229. delegateYield: function(iterable, resultName, nextLoc) {
  9230. this.delegate = {
  9231. iterator: values(iterable),
  9232. resultName: resultName,
  9233. nextLoc: nextLoc
  9234. };
  9235. if (this.method === "next") {
  9236. // Deliberately forget the last sent value so that we don't
  9237. // accidentally pass it on to the delegate.
  9238. this.arg = undefined$1;
  9239. }
  9240. return ContinueSentinel;
  9241. }
  9242. };
  9243. // Regardless of whether this script is executing as a CommonJS module
  9244. // or not, return the runtime object so that we can declare the variable
  9245. // regeneratorRuntime in the outer scope, which allows this module to be
  9246. // injected easily by `bin/regenerator --include-runtime script.js`.
  9247. return exports;
  9248. }(
  9249. // If this script is executing as a CommonJS module, use module.exports
  9250. // as the regeneratorRuntime namespace. Otherwise create a new empty
  9251. // object. Either way, the resulting object will be used to initialize
  9252. // the regeneratorRuntime variable at the top of this file.
  9253. module.exports
  9254. ));
  9255. try {
  9256. regeneratorRuntime = runtime;
  9257. } catch (accidentalStrictMode) {
  9258. // This module should not be running in strict mode, so the above
  9259. // assignment should always work unless something is misconfigured. Just
  9260. // in case runtime.js accidentally runs in strict mode, we can escape
  9261. // strict mode using a global Function call. This could conceivably fail
  9262. // if a Content Security Policy forbids using Function, but in that case
  9263. // the proper solution is to fix the accidental strict mode problem. If
  9264. // you've misconfigured your bundler to force strict mode and applied a
  9265. // CSP to forbid Function, and you're not willing to fix either of those
  9266. // problems, please detail your unique predicament in a GitHub issue.
  9267. Function("r", "regeneratorRuntime = r")(runtime);
  9268. }
  9269. });
  9270. var regenerator = runtime_1;
  9271. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  9272. try {
  9273. var info = gen[key](arg);
  9274. var value = info.value;
  9275. } catch (error) {
  9276. reject(error);
  9277. return;
  9278. }
  9279. if (info.done) {
  9280. resolve(value);
  9281. } else {
  9282. Promise.resolve(value).then(_next, _throw);
  9283. }
  9284. }
  9285. function _asyncToGenerator(fn) {
  9286. return function () {
  9287. var self = this,
  9288. args = arguments;
  9289. return new Promise(function (resolve, reject) {
  9290. var gen = fn.apply(self, args);
  9291. function _next(value) {
  9292. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  9293. }
  9294. function _throw(err) {
  9295. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  9296. }
  9297. _next(undefined);
  9298. });
  9299. };
  9300. }
  9301. var asyncToGenerator = _asyncToGenerator;
  9302. var style_class = createCommonjsModule(function (module, exports) {
  9303. Object.defineProperty(exports, "__esModule", {
  9304. value: true
  9305. });
  9306. exports["default"] = void 0;
  9307. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  9308. var _classCallCheck2 = interopRequireDefault(classCallCheck);
  9309. /**
  9310. * @description Class Style
  9311. * @param {Object} style Style configuration
  9312. * @return {Style} Instance of Style
  9313. */
  9314. var Style = function Style(style) {
  9315. (0, _classCallCheck2["default"])(this, Style);
  9316. this.colorProcessor(style);
  9317. var defaultStyle = {
  9318. /**
  9319. * @description Rgba value of graph fill color
  9320. * @type {Array}
  9321. * @default fill = [0, 0, 0, 1]
  9322. */
  9323. fill: [0, 0, 0, 1],
  9324. /**
  9325. * @description Rgba value of graph stroke color
  9326. * @type {Array}
  9327. * @default stroke = [0, 0, 0, 1]
  9328. */
  9329. stroke: [0, 0, 0, 0],
  9330. /**
  9331. * @description Opacity of graph
  9332. * @type {Number}
  9333. * @default opacity = 1
  9334. */
  9335. opacity: 1,
  9336. /**
  9337. * @description LineCap of Ctx
  9338. * @type {String}
  9339. * @default lineCap = null
  9340. * @example lineCap = 'butt'|'round'|'square'
  9341. */
  9342. lineCap: null,
  9343. /**
  9344. * @description Linejoin of Ctx
  9345. * @type {String}
  9346. * @default lineJoin = null
  9347. * @example lineJoin = 'round'|'bevel'|'miter'
  9348. */
  9349. lineJoin: null,
  9350. /**
  9351. * @description LineDash of Ctx
  9352. * @type {Array}
  9353. * @default lineDash = null
  9354. * @example lineDash = [10, 10]
  9355. */
  9356. lineDash: null,
  9357. /**
  9358. * @description LineDashOffset of Ctx
  9359. * @type {Number}
  9360. * @default lineDashOffset = null
  9361. * @example lineDashOffset = 10
  9362. */
  9363. lineDashOffset: null,
  9364. /**
  9365. * @description ShadowBlur of Ctx
  9366. * @type {Number}
  9367. * @default shadowBlur = 0
  9368. */
  9369. shadowBlur: 0,
  9370. /**
  9371. * @description Rgba value of graph shadow color
  9372. * @type {Array}
  9373. * @default shadowColor = [0, 0, 0, 0]
  9374. */
  9375. shadowColor: [0, 0, 0, 0],
  9376. /**
  9377. * @description ShadowOffsetX of Ctx
  9378. * @type {Number}
  9379. * @default shadowOffsetX = 0
  9380. */
  9381. shadowOffsetX: 0,
  9382. /**
  9383. * @description ShadowOffsetY of Ctx
  9384. * @type {Number}
  9385. * @default shadowOffsetY = 0
  9386. */
  9387. shadowOffsetY: 0,
  9388. /**
  9389. * @description LineWidth of Ctx
  9390. * @type {Number}
  9391. * @default lineWidth = 0
  9392. */
  9393. lineWidth: 0,
  9394. /**
  9395. * @description Center point of the graph
  9396. * @type {Array}
  9397. * @default graphCenter = null
  9398. * @example graphCenter = [10, 10]
  9399. */
  9400. graphCenter: null,
  9401. /**
  9402. * @description Graph scale
  9403. * @type {Array}
  9404. * @default scale = null
  9405. * @example scale = [1.5, 1.5]
  9406. */
  9407. scale: null,
  9408. /**
  9409. * @description Graph rotation degree
  9410. * @type {Number}
  9411. * @default rotate = null
  9412. * @example rotate = 10
  9413. */
  9414. rotate: null,
  9415. /**
  9416. * @description Graph translate distance
  9417. * @type {Array}
  9418. * @default translate = null
  9419. * @example translate = [10, 10]
  9420. */
  9421. translate: null,
  9422. /**
  9423. * @description Cursor status when hover
  9424. * @type {String}
  9425. * @default hoverCursor = 'pointer'
  9426. * @example hoverCursor = 'default'|'pointer'|'auto'|'crosshair'|'move'|'wait'|...
  9427. */
  9428. hoverCursor: 'pointer',
  9429. /**
  9430. * @description Font style of Ctx
  9431. * @type {String}
  9432. * @default fontStyle = 'normal'
  9433. * @example fontStyle = 'normal'|'italic'|'oblique'
  9434. */
  9435. fontStyle: 'normal',
  9436. /**
  9437. * @description Font varient of Ctx
  9438. * @type {String}
  9439. * @default fontVarient = 'normal'
  9440. * @example fontVarient = 'normal'|'small-caps'
  9441. */
  9442. fontVarient: 'normal',
  9443. /**
  9444. * @description Font weight of Ctx
  9445. * @type {String|Number}
  9446. * @default fontWeight = 'normal'
  9447. * @example fontWeight = 'normal'|'bold'|'bolder'|'lighter'|Number
  9448. */
  9449. fontWeight: 'normal',
  9450. /**
  9451. * @description Font size of Ctx
  9452. * @type {Number}
  9453. * @default fontSize = 10
  9454. */
  9455. fontSize: 10,
  9456. /**
  9457. * @description Font family of Ctx
  9458. * @type {String}
  9459. * @default fontFamily = 'Arial'
  9460. */
  9461. fontFamily: 'Arial',
  9462. /**
  9463. * @description TextAlign of Ctx
  9464. * @type {String}
  9465. * @default textAlign = 'center'
  9466. * @example textAlign = 'start'|'end'|'left'|'right'|'center'
  9467. */
  9468. textAlign: 'center',
  9469. /**
  9470. * @description TextBaseline of Ctx
  9471. * @type {String}
  9472. * @default textBaseline = 'middle'
  9473. * @example textBaseline = 'top'|'bottom'|'middle'|'alphabetic'|'hanging'
  9474. */
  9475. textBaseline: 'middle',
  9476. /**
  9477. * @description The color used to create the gradient
  9478. * @type {Array}
  9479. * @default gradientColor = null
  9480. * @example gradientColor = ['#000', '#111', '#222']
  9481. */
  9482. gradientColor: null,
  9483. /**
  9484. * @description Gradient type
  9485. * @type {String}
  9486. * @default gradientType = 'linear'
  9487. * @example gradientType = 'linear' | 'radial'
  9488. */
  9489. gradientType: 'linear',
  9490. /**
  9491. * @description Gradient params
  9492. * @type {Array}
  9493. * @default gradientParams = null
  9494. * @example gradientParams = [x0, y0, x1, y1] (Linear Gradient)
  9495. * @example gradientParams = [x0, y0, r0, x1, y1, r1] (Radial Gradient)
  9496. */
  9497. gradientParams: null,
  9498. /**
  9499. * @description When to use gradients
  9500. * @type {String}
  9501. * @default gradientWith = 'stroke'
  9502. * @example gradientWith = 'stroke' | 'fill'
  9503. */
  9504. gradientWith: 'stroke',
  9505. /**
  9506. * @description Gradient color stops
  9507. * @type {String}
  9508. * @default gradientStops = 'auto'
  9509. * @example gradientStops = 'auto' | [0, .2, .3, 1]
  9510. */
  9511. gradientStops: 'auto',
  9512. /**
  9513. * @description Extended color that supports animation transition
  9514. * @type {Array|Object}
  9515. * @default colors = null
  9516. * @example colors = ['#000', '#111', '#222', 'red' ]
  9517. * @example colors = { a: '#000', b: '#111' }
  9518. */
  9519. colors: null
  9520. };
  9521. Object.assign(this, defaultStyle, style);
  9522. };
  9523. /**
  9524. * @description Set colors to rgba value
  9525. * @param {Object} style style config
  9526. * @param {Boolean} reverse Whether to perform reverse operation
  9527. * @return {Undefined} Void
  9528. */
  9529. exports["default"] = Style;
  9530. Style.prototype.colorProcessor = function (style) {
  9531. var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  9532. var processor = reverse ? lib.getColorFromRgbValue : lib.getRgbaValue;
  9533. var colorProcessorKeys = ['fill', 'stroke', 'shadowColor'];
  9534. var allKeys = Object.keys(style);
  9535. var colorKeys = allKeys.filter(function (key) {
  9536. return colorProcessorKeys.find(function (k) {
  9537. return k === key;
  9538. });
  9539. });
  9540. colorKeys.forEach(function (key) {
  9541. return style[key] = processor(style[key]);
  9542. });
  9543. var gradientColor = style.gradientColor,
  9544. colors = style.colors;
  9545. if (gradientColor) style.gradientColor = gradientColor.map(function (c) {
  9546. return processor(c);
  9547. });
  9548. if (colors) {
  9549. var colorsKeys = Object.keys(colors);
  9550. colorsKeys.forEach(function (key) {
  9551. return colors[key] = processor(colors[key]);
  9552. });
  9553. }
  9554. };
  9555. /**
  9556. * @description Init graph style
  9557. * @param {Object} ctx Context of canvas
  9558. * @return {Undefined} Void
  9559. */
  9560. Style.prototype.initStyle = function (ctx) {
  9561. initTransform(ctx, this);
  9562. initGraphStyle(ctx, this);
  9563. initGradient(ctx, this);
  9564. };
  9565. /**
  9566. * @description Init canvas transform
  9567. * @param {Object} ctx Context of canvas
  9568. * @param {Style} style Instance of Style
  9569. * @return {Undefined} Void
  9570. */
  9571. function initTransform(ctx, style) {
  9572. ctx.save();
  9573. var graphCenter = style.graphCenter,
  9574. rotate = style.rotate,
  9575. scale = style.scale,
  9576. translate = style.translate;
  9577. if (!(graphCenter instanceof Array)) return;
  9578. ctx.translate.apply(ctx, (0, _toConsumableArray2["default"])(graphCenter));
  9579. if (rotate) ctx.rotate(rotate * Math.PI / 180);
  9580. if (scale instanceof Array) ctx.scale.apply(ctx, (0, _toConsumableArray2["default"])(scale));
  9581. if (translate) ctx.translate.apply(ctx, (0, _toConsumableArray2["default"])(translate));
  9582. ctx.translate(-graphCenter[0], -graphCenter[1]);
  9583. }
  9584. var autoSetStyleKeys = ['lineCap', 'lineJoin', 'lineDashOffset', 'shadowOffsetX', 'shadowOffsetY', 'lineWidth', 'textAlign', 'textBaseline'];
  9585. /**
  9586. * @description Set the style of canvas ctx
  9587. * @param {Object} ctx Context of canvas
  9588. * @param {Style} style Instance of Style
  9589. * @return {Undefined} Void
  9590. */
  9591. function initGraphStyle(ctx, style) {
  9592. var fill = style.fill,
  9593. stroke = style.stroke,
  9594. shadowColor = style.shadowColor,
  9595. opacity = style.opacity;
  9596. autoSetStyleKeys.forEach(function (key) {
  9597. if (key || typeof key === 'number') ctx[key] = style[key];
  9598. });
  9599. fill = (0, _toConsumableArray2["default"])(fill);
  9600. stroke = (0, _toConsumableArray2["default"])(stroke);
  9601. shadowColor = (0, _toConsumableArray2["default"])(shadowColor);
  9602. fill[3] *= opacity;
  9603. stroke[3] *= opacity;
  9604. shadowColor[3] *= opacity;
  9605. ctx.fillStyle = (0, lib.getColorFromRgbValue)(fill);
  9606. ctx.strokeStyle = (0, lib.getColorFromRgbValue)(stroke);
  9607. ctx.shadowColor = (0, lib.getColorFromRgbValue)(shadowColor);
  9608. var lineDash = style.lineDash,
  9609. shadowBlur = style.shadowBlur;
  9610. if (lineDash) {
  9611. lineDash = lineDash.map(function (v) {
  9612. return v >= 0 ? v : 0;
  9613. });
  9614. ctx.setLineDash(lineDash);
  9615. }
  9616. if (typeof shadowBlur === 'number') ctx.shadowBlur = shadowBlur > 0 ? shadowBlur : 0.001;
  9617. var fontStyle = style.fontStyle,
  9618. fontVarient = style.fontVarient,
  9619. fontWeight = style.fontWeight,
  9620. fontSize = style.fontSize,
  9621. fontFamily = style.fontFamily;
  9622. ctx.font = fontStyle + ' ' + fontVarient + ' ' + fontWeight + ' ' + fontSize + 'px' + ' ' + fontFamily;
  9623. }
  9624. /**
  9625. * @description Set the gradient color of canvas ctx
  9626. * @param {Object} ctx Context of canvas
  9627. * @param {Style} style Instance of Style
  9628. * @return {Undefined} Void
  9629. */
  9630. function initGradient(ctx, style) {
  9631. if (!gradientValidator(style)) return;
  9632. var gradientColor = style.gradientColor,
  9633. gradientParams = style.gradientParams,
  9634. gradientType = style.gradientType,
  9635. gradientWith = style.gradientWith,
  9636. gradientStops = style.gradientStops,
  9637. opacity = style.opacity;
  9638. gradientColor = gradientColor.map(function (color) {
  9639. var colorOpacity = color[3] * opacity;
  9640. var clonedColor = (0, _toConsumableArray2["default"])(color);
  9641. clonedColor[3] = colorOpacity;
  9642. return clonedColor;
  9643. });
  9644. gradientColor = gradientColor.map(function (c) {
  9645. return (0, lib.getColorFromRgbValue)(c);
  9646. });
  9647. if (gradientStops === 'auto') gradientStops = getAutoColorStops(gradientColor);
  9648. var gradient = ctx["create".concat(gradientType.slice(0, 1).toUpperCase() + gradientType.slice(1), "Gradient")].apply(ctx, (0, _toConsumableArray2["default"])(gradientParams));
  9649. gradientStops.forEach(function (stop, i) {
  9650. return gradient.addColorStop(stop, gradientColor[i]);
  9651. });
  9652. ctx["".concat(gradientWith, "Style")] = gradient;
  9653. }
  9654. /**
  9655. * @description Check if the gradient configuration is legal
  9656. * @param {Style} style Instance of Style
  9657. * @return {Boolean} Check Result
  9658. */
  9659. function gradientValidator(style) {
  9660. var gradientColor = style.gradientColor,
  9661. gradientParams = style.gradientParams,
  9662. gradientType = style.gradientType,
  9663. gradientWith = style.gradientWith,
  9664. gradientStops = style.gradientStops;
  9665. if (!gradientColor || !gradientParams) return false;
  9666. if (gradientColor.length === 1) {
  9667. console.warn('The gradient needs to provide at least two colors');
  9668. return false;
  9669. }
  9670. if (gradientType !== 'linear' && gradientType !== 'radial') {
  9671. console.warn('GradientType only supports linear or radial, current value is ' + gradientType);
  9672. return false;
  9673. }
  9674. var gradientParamsLength = gradientParams.length;
  9675. if (gradientType === 'linear' && gradientParamsLength !== 4 || gradientType === 'radial' && gradientParamsLength !== 6) {
  9676. console.warn('The expected length of gradientParams is ' + (gradientType === 'linear' ? '4' : '6'));
  9677. return false;
  9678. }
  9679. if (gradientWith !== 'fill' && gradientWith !== 'stroke') {
  9680. console.warn('GradientWith only supports fill or stroke, current value is ' + gradientWith);
  9681. return false;
  9682. }
  9683. if (gradientStops !== 'auto' && !(gradientStops instanceof Array)) {
  9684. console.warn("gradientStops only supports 'auto' or Number Array ([0, .5, 1]), current value is " + gradientStops);
  9685. return false;
  9686. }
  9687. return true;
  9688. }
  9689. /**
  9690. * @description Get a uniform gradient color stop
  9691. * @param {Array} color Gradient color
  9692. * @return {Array} Gradient color stop
  9693. */
  9694. function getAutoColorStops(color) {
  9695. var stopGap = 1 / (color.length - 1);
  9696. return color.map(function (foo, i) {
  9697. return stopGap * i;
  9698. });
  9699. }
  9700. /**
  9701. * @description Restore canvas ctx transform
  9702. * @param {Object} ctx Context of canvas
  9703. * @return {Undefined} Void
  9704. */
  9705. Style.prototype.restoreTransform = function (ctx) {
  9706. ctx.restore();
  9707. };
  9708. /**
  9709. * @description Update style data
  9710. * @param {Object} change Changed data
  9711. * @return {Undefined} Void
  9712. */
  9713. Style.prototype.update = function (change) {
  9714. this.colorProcessor(change);
  9715. Object.assign(this, change);
  9716. };
  9717. /**
  9718. * @description Get the current style configuration
  9719. * @return {Object} Style configuration
  9720. */
  9721. Style.prototype.getStyle = function () {
  9722. var clonedStyle = (0, util.deepClone)(this, true);
  9723. this.colorProcessor(clonedStyle, true);
  9724. return clonedStyle;
  9725. };
  9726. });
  9727. unwrapExports(style_class);
  9728. var curves = createCommonjsModule(function (module, exports) {
  9729. Object.defineProperty(exports, "__esModule", {
  9730. value: true
  9731. });
  9732. exports["default"] = exports.easeInOutBounce = exports.easeOutBounce = exports.easeInBounce = exports.easeInOutElastic = exports.easeOutElastic = exports.easeInElastic = exports.easeInOutBack = exports.easeOutBack = exports.easeInBack = exports.easeInOutQuint = exports.easeOutQuint = exports.easeInQuint = exports.easeInOutQuart = exports.easeOutQuart = exports.easeInQuart = exports.easeInOutCubic = exports.easeOutCubic = exports.easeInCubic = exports.easeInOutQuad = exports.easeOutQuad = exports.easeInQuad = exports.easeInOutSine = exports.easeOutSine = exports.easeInSine = exports.linear = void 0;
  9733. var linear = [[[0, 1], '', [0.33, 0.67]], [[1, 0], [0.67, 0.33]]];
  9734. /**
  9735. * @description Sine
  9736. */
  9737. exports.linear = linear;
  9738. var easeInSine = [[[0, 1]], [[0.538, 0.564], [0.169, 0.912], [0.880, 0.196]], [[1, 0]]];
  9739. exports.easeInSine = easeInSine;
  9740. var easeOutSine = [[[0, 1]], [[0.444, 0.448], [0.169, 0.736], [0.718, 0.16]], [[1, 0]]];
  9741. exports.easeOutSine = easeOutSine;
  9742. var easeInOutSine = [[[0, 1]], [[0.5, 0.5], [0.2, 1], [0.8, 0]], [[1, 0]]];
  9743. /**
  9744. * @description Quad
  9745. */
  9746. exports.easeInOutSine = easeInOutSine;
  9747. var easeInQuad = [[[0, 1]], [[0.550, 0.584], [0.231, 0.904], [0.868, 0.264]], [[1, 0]]];
  9748. exports.easeInQuad = easeInQuad;
  9749. var easeOutQuad = [[[0, 1]], [[0.413, 0.428], [0.065, 0.816], [0.760, 0.04]], [[1, 0]]];
  9750. exports.easeOutQuad = easeOutQuad;
  9751. var easeInOutQuad = [[[0, 1]], [[0.5, 0.5], [0.3, 0.9], [0.7, 0.1]], [[1, 0]]];
  9752. /**
  9753. * @description Cubic
  9754. */
  9755. exports.easeInOutQuad = easeInOutQuad;
  9756. var easeInCubic = [[[0, 1]], [[0.679, 0.688], [0.366, 0.992], [0.992, 0.384]], [[1, 0]]];
  9757. exports.easeInCubic = easeInCubic;
  9758. var easeOutCubic = [[[0, 1]], [[0.321, 0.312], [0.008, 0.616], [0.634, 0.008]], [[1, 0]]];
  9759. exports.easeOutCubic = easeOutCubic;
  9760. var easeInOutCubic = [[[0, 1]], [[0.5, 0.5], [0.3, 1], [0.7, 0]], [[1, 0]]];
  9761. /**
  9762. * @description Quart
  9763. */
  9764. exports.easeInOutCubic = easeInOutCubic;
  9765. var easeInQuart = [[[0, 1]], [[0.812, 0.74], [0.611, 0.988], [1.013, 0.492]], [[1, 0]]];
  9766. exports.easeInQuart = easeInQuart;
  9767. var easeOutQuart = [[[0, 1]], [[0.152, 0.244], [0.001, 0.448], [0.285, -0.02]], [[1, 0]]];
  9768. exports.easeOutQuart = easeOutQuart;
  9769. var easeInOutQuart = [[[0, 1]], [[0.5, 0.5], [0.4, 1], [0.6, 0]], [[1, 0]]];
  9770. /**
  9771. * @description Quint
  9772. */
  9773. exports.easeInOutQuart = easeInOutQuart;
  9774. var easeInQuint = [[[0, 1]], [[0.857, 0.856], [0.714, 1], [1, 0.712]], [[1, 0]]];
  9775. exports.easeInQuint = easeInQuint;
  9776. var easeOutQuint = [[[0, 1]], [[0.108, 0.2], [0.001, 0.4], [0.214, -0.012]], [[1, 0]]];
  9777. exports.easeOutQuint = easeOutQuint;
  9778. var easeInOutQuint = [[[0, 1]], [[0.5, 0.5], [0.5, 1], [0.5, 0]], [[1, 0]]];
  9779. /**
  9780. * @description Back
  9781. */
  9782. exports.easeInOutQuint = easeInOutQuint;
  9783. var easeInBack = [[[0, 1]], [[0.667, 0.896], [0.380, 1.184], [0.955, 0.616]], [[1, 0]]];
  9784. exports.easeInBack = easeInBack;
  9785. var easeOutBack = [[[0, 1]], [[0.335, 0.028], [0.061, 0.22], [0.631, -0.18]], [[1, 0]]];
  9786. exports.easeOutBack = easeOutBack;
  9787. var easeInOutBack = [[[0, 1]], [[0.5, 0.5], [0.4, 1.4], [0.6, -0.4]], [[1, 0]]];
  9788. /**
  9789. * @description Elastic
  9790. */
  9791. exports.easeInOutBack = easeInOutBack;
  9792. var easeInElastic = [[[0, 1]], [[0.474, 0.964], [0.382, 0.988], [0.557, 0.952]], [[0.619, 1.076], [0.565, 1.088], [0.669, 1.08]], [[0.770, 0.916], [0.712, 0.924], [0.847, 0.904]], [[0.911, 1.304], [0.872, 1.316], [0.961, 1.34]], [[1, 0]]];
  9793. exports.easeInElastic = easeInElastic;
  9794. var easeOutElastic = [[[0, 1]], [[0.073, -0.32], [0.034, -0.328], [0.104, -0.344]], [[0.191, 0.092], [0.110, 0.06], [0.256, 0.08]], [[0.310, -0.076], [0.260, -0.068], [0.357, -0.076]], [[0.432, 0.032], [0.362, 0.028], [0.683, -0.004]], [[1, 0]]];
  9795. exports.easeOutElastic = easeOutElastic;
  9796. var easeInOutElastic = [[[0, 1]], [[0.210, 0.94], [0.167, 0.884], [0.252, 0.98]], [[0.299, 1.104], [0.256, 1.092], [0.347, 1.108]], [[0.5, 0.496], [0.451, 0.672], [0.548, 0.324]], [[0.696, -0.108], [0.652, -0.112], [0.741, -0.124]], [[0.805, 0.064], [0.756, 0.012], [0.866, 0.096]], [[1, 0]]];
  9797. /**
  9798. * @description Bounce
  9799. */
  9800. exports.easeInOutElastic = easeInOutElastic;
  9801. var easeInBounce = [[[0, 1]], [[0.148, 1], [0.075, 0.868], [0.193, 0.848]], [[0.326, 1], [0.276, 0.836], [0.405, 0.712]], [[0.600, 1], [0.511, 0.708], [0.671, 0.348]], [[1, 0]]];
  9802. exports.easeInBounce = easeInBounce;
  9803. var easeOutBounce = [[[0, 1]], [[0.357, 0.004], [0.270, 0.592], [0.376, 0.252]], [[0.604, -0.004], [0.548, 0.312], [0.669, 0.184]], [[0.820, 0], [0.749, 0.184], [0.905, 0.132]], [[1, 0]]];
  9804. exports.easeOutBounce = easeOutBounce;
  9805. var easeInOutBounce = [[[0, 1]], [[0.102, 1], [0.050, 0.864], [0.117, 0.86]], [[0.216, 0.996], [0.208, 0.844], [0.227, 0.808]], [[0.347, 0.996], [0.343, 0.8], [0.480, 0.292]], [[0.635, 0.004], [0.511, 0.676], [0.656, 0.208]], [[0.787, 0], [0.760, 0.2], [0.795, 0.144]], [[0.905, -0.004], [0.899, 0.164], [0.944, 0.144]], [[1, 0]]];
  9806. exports.easeInOutBounce = easeInOutBounce;
  9807. var _default = new Map([['linear', linear], ['easeInSine', easeInSine], ['easeOutSine', easeOutSine], ['easeInOutSine', easeInOutSine], ['easeInQuad', easeInQuad], ['easeOutQuad', easeOutQuad], ['easeInOutQuad', easeInOutQuad], ['easeInCubic', easeInCubic], ['easeOutCubic', easeOutCubic], ['easeInOutCubic', easeInOutCubic], ['easeInQuart', easeInQuart], ['easeOutQuart', easeOutQuart], ['easeInOutQuart', easeInOutQuart], ['easeInQuint', easeInQuint], ['easeOutQuint', easeOutQuint], ['easeInOutQuint', easeInOutQuint], ['easeInBack', easeInBack], ['easeOutBack', easeOutBack], ['easeInOutBack', easeInOutBack], ['easeInElastic', easeInElastic], ['easeOutElastic', easeOutElastic], ['easeInOutElastic', easeInOutElastic], ['easeInBounce', easeInBounce], ['easeOutBounce', easeOutBounce], ['easeInOutBounce', easeInOutBounce]]);
  9808. exports["default"] = _default;
  9809. });
  9810. unwrapExports(curves);
  9811. var curves_1 = curves.easeInOutBounce;
  9812. var curves_2 = curves.easeOutBounce;
  9813. var curves_3 = curves.easeInBounce;
  9814. var curves_4 = curves.easeInOutElastic;
  9815. var curves_5 = curves.easeOutElastic;
  9816. var curves_6 = curves.easeInElastic;
  9817. var curves_7 = curves.easeInOutBack;
  9818. var curves_8 = curves.easeOutBack;
  9819. var curves_9 = curves.easeInBack;
  9820. var curves_10 = curves.easeInOutQuint;
  9821. var curves_11 = curves.easeOutQuint;
  9822. var curves_12 = curves.easeInQuint;
  9823. var curves_13 = curves.easeInOutQuart;
  9824. var curves_14 = curves.easeOutQuart;
  9825. var curves_15 = curves.easeInQuart;
  9826. var curves_16 = curves.easeInOutCubic;
  9827. var curves_17 = curves.easeOutCubic;
  9828. var curves_18 = curves.easeInCubic;
  9829. var curves_19 = curves.easeInOutQuad;
  9830. var curves_20 = curves.easeOutQuad;
  9831. var curves_21 = curves.easeInQuad;
  9832. var curves_22 = curves.easeInOutSine;
  9833. var curves_23 = curves.easeOutSine;
  9834. var curves_24 = curves.easeInSine;
  9835. var curves_25 = curves.linear;
  9836. var lib$2 = createCommonjsModule(function (module, exports) {
  9837. Object.defineProperty(exports, "__esModule", {
  9838. value: true
  9839. });
  9840. exports.transition = transition;
  9841. exports.injectNewCurve = injectNewCurve;
  9842. exports["default"] = void 0;
  9843. var _slicedToArray2 = interopRequireDefault(slicedToArray);
  9844. var _typeof2 = interopRequireDefault(_typeof_1);
  9845. var _curves = interopRequireDefault(curves);
  9846. var defaultTransitionBC = 'linear';
  9847. /**
  9848. * @description Get the N-frame animation state by the start and end state
  9849. * of the animation and the easing curve
  9850. * @param {String|Array} tBC Easing curve name or data
  9851. * @param {Number|Array|Object} startState Animation start state
  9852. * @param {Number|Array|Object} endState Animation end state
  9853. * @param {Number} frameNum Number of Animation frames
  9854. * @param {Boolean} deep Whether to use recursive mode
  9855. * @return {Array|Boolean} State of each frame of the animation (Invalid input will return false)
  9856. */
  9857. function transition(tBC) {
  9858. var startState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  9859. var endState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  9860. var frameNum = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 30;
  9861. var deep = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  9862. if (!checkParams.apply(void 0, arguments)) return false;
  9863. try {
  9864. // Get the transition bezier curve
  9865. var bezierCurve = getBezierCurve(tBC); // Get the progress of each frame state
  9866. var frameStateProgress = getFrameStateProgress(bezierCurve, frameNum); // If the recursion mode is not enabled or the state type is Number, the shallow state calculation is performed directly.
  9867. if (!deep || typeof endState === 'number') return getTransitionState(startState, endState, frameStateProgress);
  9868. return recursionTransitionState(startState, endState, frameStateProgress);
  9869. } catch (_unused) {
  9870. console.warn('Transition parameter may be abnormal!');
  9871. return [endState];
  9872. }
  9873. }
  9874. /**
  9875. * @description Check if the parameters are legal
  9876. * @param {String} tBC Name of transition bezier curve
  9877. * @param {Any} startState Transition start state
  9878. * @param {Any} endState Transition end state
  9879. * @param {Number} frameNum Number of transition frames
  9880. * @return {Boolean} Is the parameter legal
  9881. */
  9882. function checkParams(tBC) {
  9883. var startState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  9884. var endState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  9885. var frameNum = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 30;
  9886. if (!tBC || startState === false || endState === false || !frameNum) {
  9887. console.error('transition: Missing Parameters!');
  9888. return false;
  9889. }
  9890. if ((0, _typeof2["default"])(startState) !== (0, _typeof2["default"])(endState)) {
  9891. console.error('transition: Inconsistent Status Types!');
  9892. return false;
  9893. }
  9894. var stateType = (0, _typeof2["default"])(endState);
  9895. if (stateType === 'string' || stateType === 'boolean' || !tBC.length) {
  9896. console.error('transition: Unsupported Data Type of State!');
  9897. return false;
  9898. }
  9899. if (!_curves["default"].has(tBC) && !(tBC instanceof Array)) {
  9900. console.warn('transition: Transition curve not found, default curve will be used!');
  9901. }
  9902. return true;
  9903. }
  9904. /**
  9905. * @description Get the transition bezier curve
  9906. * @param {String} tBC Name of transition bezier curve
  9907. * @return {Array} Bezier curve data
  9908. */
  9909. function getBezierCurve(tBC) {
  9910. var bezierCurve = '';
  9911. if (_curves["default"].has(tBC)) {
  9912. bezierCurve = _curves["default"].get(tBC);
  9913. } else if (tBC instanceof Array) {
  9914. bezierCurve = tBC;
  9915. } else {
  9916. bezierCurve = _curves["default"].get(defaultTransitionBC);
  9917. }
  9918. return bezierCurve;
  9919. }
  9920. /**
  9921. * @description Get the progress of each frame state
  9922. * @param {Array} bezierCurve Transition bezier curve
  9923. * @param {Number} frameNum Number of transition frames
  9924. * @return {Array} Progress of each frame state
  9925. */
  9926. function getFrameStateProgress(bezierCurve, frameNum) {
  9927. var tMinus = 1 / (frameNum - 1);
  9928. var tState = new Array(frameNum).fill(0).map(function (t, i) {
  9929. return i * tMinus;
  9930. });
  9931. var frameState = tState.map(function (t) {
  9932. return getFrameStateFromT(bezierCurve, t);
  9933. });
  9934. return frameState;
  9935. }
  9936. /**
  9937. * @description Get the progress of the corresponding frame according to t
  9938. * @param {Array} bezierCurve Transition bezier curve
  9939. * @param {Number} t Current frame t
  9940. * @return {Number} Progress of current frame
  9941. */
  9942. function getFrameStateFromT(bezierCurve, t) {
  9943. var tBezierCurvePoint = getBezierCurvePointFromT(bezierCurve, t);
  9944. var bezierCurvePointT = getBezierCurvePointTFromReT(tBezierCurvePoint, t);
  9945. return getBezierCurveTState(tBezierCurvePoint, bezierCurvePointT);
  9946. }
  9947. /**
  9948. * @description Get the corresponding sub-curve according to t
  9949. * @param {Array} bezierCurve Transition bezier curve
  9950. * @param {Number} t Current frame t
  9951. * @return {Array} Sub-curve of t
  9952. */
  9953. function getBezierCurvePointFromT(bezierCurve, t) {
  9954. var lastIndex = bezierCurve.length - 1;
  9955. var begin = '',
  9956. end = '';
  9957. bezierCurve.findIndex(function (item, i) {
  9958. if (i === lastIndex) return;
  9959. begin = item;
  9960. end = bezierCurve[i + 1];
  9961. var currentMainPointX = begin[0][0];
  9962. var nextMainPointX = end[0][0];
  9963. return t >= currentMainPointX && t < nextMainPointX;
  9964. });
  9965. var p0 = begin[0];
  9966. var p1 = begin[2] || begin[0];
  9967. var p2 = end[1] || end[0];
  9968. var p3 = end[0];
  9969. return [p0, p1, p2, p3];
  9970. }
  9971. /**
  9972. * @description Get local t based on t and sub-curve
  9973. * @param {Array} bezierCurve Sub-curve
  9974. * @param {Number} t Current frame t
  9975. * @return {Number} local t of sub-curve
  9976. */
  9977. function getBezierCurvePointTFromReT(bezierCurve, t) {
  9978. var reBeginX = bezierCurve[0][0];
  9979. var reEndX = bezierCurve[3][0];
  9980. var xMinus = reEndX - reBeginX;
  9981. var tMinus = t - reBeginX;
  9982. return tMinus / xMinus;
  9983. }
  9984. /**
  9985. * @description Get the curve progress of t
  9986. * @param {Array} bezierCurve Sub-curve
  9987. * @param {Number} t Current frame t
  9988. * @return {Number} Progress of current frame
  9989. */
  9990. function getBezierCurveTState(_ref, t) {
  9991. var _ref2 = (0, _slicedToArray2["default"])(_ref, 4),
  9992. _ref2$ = (0, _slicedToArray2["default"])(_ref2[0], 2),
  9993. p0 = _ref2$[1],
  9994. _ref2$2 = (0, _slicedToArray2["default"])(_ref2[1], 2),
  9995. p1 = _ref2$2[1],
  9996. _ref2$3 = (0, _slicedToArray2["default"])(_ref2[2], 2),
  9997. p2 = _ref2$3[1],
  9998. _ref2$4 = (0, _slicedToArray2["default"])(_ref2[3], 2),
  9999. p3 = _ref2$4[1];
  10000. var pow = Math.pow;
  10001. var tMinus = 1 - t;
  10002. var result1 = p0 * pow(tMinus, 3);
  10003. var result2 = 3 * p1 * t * pow(tMinus, 2);
  10004. var result3 = 3 * p2 * pow(t, 2) * tMinus;
  10005. var result4 = p3 * pow(t, 3);
  10006. return 1 - (result1 + result2 + result3 + result4);
  10007. }
  10008. /**
  10009. * @description Get transition state according to frame progress
  10010. * @param {Any} startState Transition start state
  10011. * @param {Any} endState Transition end state
  10012. * @param {Array} frameState Frame state progress
  10013. * @return {Array} Transition frame state
  10014. */
  10015. function getTransitionState(begin, end, frameState) {
  10016. var stateType = 'object';
  10017. if (typeof begin === 'number') stateType = 'number';
  10018. if (begin instanceof Array) stateType = 'array';
  10019. if (stateType === 'number') return getNumberTransitionState(begin, end, frameState);
  10020. if (stateType === 'array') return getArrayTransitionState(begin, end, frameState);
  10021. if (stateType === 'object') return getObjectTransitionState(begin, end, frameState);
  10022. return frameState.map(function (t) {
  10023. return end;
  10024. });
  10025. }
  10026. /**
  10027. * @description Get the transition data of the number type
  10028. * @param {Number} startState Transition start state
  10029. * @param {Number} endState Transition end state
  10030. * @param {Array} frameState Frame state progress
  10031. * @return {Array} Transition frame state
  10032. */
  10033. function getNumberTransitionState(begin, end, frameState) {
  10034. var minus = end - begin;
  10035. return frameState.map(function (s) {
  10036. return begin + minus * s;
  10037. });
  10038. }
  10039. /**
  10040. * @description Get the transition data of the array type
  10041. * @param {Array} startState Transition start state
  10042. * @param {Array} endState Transition end state
  10043. * @param {Array} frameState Frame state progress
  10044. * @return {Array} Transition frame state
  10045. */
  10046. function getArrayTransitionState(begin, end, frameState) {
  10047. var minus = end.map(function (v, i) {
  10048. if (typeof v !== 'number') return false;
  10049. return v - begin[i];
  10050. });
  10051. return frameState.map(function (s) {
  10052. return minus.map(function (v, i) {
  10053. if (v === false) return end[i];
  10054. return begin[i] + v * s;
  10055. });
  10056. });
  10057. }
  10058. /**
  10059. * @description Get the transition data of the object type
  10060. * @param {Object} startState Transition start state
  10061. * @param {Object} endState Transition end state
  10062. * @param {Array} frameState Frame state progress
  10063. * @return {Array} Transition frame state
  10064. */
  10065. function getObjectTransitionState(begin, end, frameState) {
  10066. var keys = Object.keys(end);
  10067. var beginValue = keys.map(function (k) {
  10068. return begin[k];
  10069. });
  10070. var endValue = keys.map(function (k) {
  10071. return end[k];
  10072. });
  10073. var arrayState = getArrayTransitionState(beginValue, endValue, frameState);
  10074. return arrayState.map(function (item) {
  10075. var frameData = {};
  10076. item.forEach(function (v, i) {
  10077. return frameData[keys[i]] = v;
  10078. });
  10079. return frameData;
  10080. });
  10081. }
  10082. /**
  10083. * @description Get the transition state data by recursion
  10084. * @param {Array|Object} startState Transition start state
  10085. * @param {Array|Object} endState Transition end state
  10086. * @param {Array} frameState Frame state progress
  10087. * @return {Array} Transition frame state
  10088. */
  10089. function recursionTransitionState(begin, end, frameState) {
  10090. var state = getTransitionState(begin, end, frameState);
  10091. var _loop = function _loop(key) {
  10092. var bTemp = begin[key];
  10093. var eTemp = end[key];
  10094. if ((0, _typeof2["default"])(eTemp) !== 'object') return "continue";
  10095. var data = recursionTransitionState(bTemp, eTemp, frameState);
  10096. state.forEach(function (fs, i) {
  10097. return fs[key] = data[i];
  10098. });
  10099. };
  10100. for (var key in end) {
  10101. var _ret = _loop(key);
  10102. if (_ret === "continue") continue;
  10103. }
  10104. return state;
  10105. }
  10106. /**
  10107. * @description Inject new curve into curves as config
  10108. * @param {Any} key The key of curve
  10109. * @param {Array} curve Bezier curve data
  10110. * @return {Undefined} No return
  10111. */
  10112. function injectNewCurve(key, curve) {
  10113. if (!key || !curve) {
  10114. console.error('InjectNewCurve Missing Parameters!');
  10115. return;
  10116. }
  10117. _curves["default"].set(key, curve);
  10118. }
  10119. var _default = transition;
  10120. exports["default"] = _default;
  10121. });
  10122. unwrapExports(lib$2);
  10123. var lib_1$1 = lib$2.transition;
  10124. var lib_2$1 = lib$2.injectNewCurve;
  10125. var graph_class = createCommonjsModule(function (module, exports) {
  10126. Object.defineProperty(exports, "__esModule", {
  10127. value: true
  10128. });
  10129. exports["default"] = void 0;
  10130. var _regenerator = interopRequireDefault(regenerator);
  10131. var _asyncToGenerator2 = interopRequireDefault(asyncToGenerator);
  10132. var _typeof2 = interopRequireDefault(_typeof_1);
  10133. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  10134. var _classCallCheck2 = interopRequireDefault(classCallCheck);
  10135. var _style = interopRequireDefault(style_class);
  10136. var _transition = interopRequireDefault(lib$2);
  10137. /**
  10138. * @description Class Graph
  10139. * @param {Object} graph Graph default configuration
  10140. * @param {Object} config Graph config
  10141. * @return {Graph} Instance of Graph
  10142. */
  10143. var Graph = function Graph(graph, config) {
  10144. (0, _classCallCheck2["default"])(this, Graph);
  10145. config = (0, util.deepClone)(config, true);
  10146. var defaultConfig = {
  10147. /**
  10148. * @description Weather to render graph
  10149. * @type {Boolean}
  10150. * @default visible = true
  10151. */
  10152. visible: true,
  10153. /**
  10154. * @description Whether to enable drag
  10155. * @type {Boolean}
  10156. * @default drag = false
  10157. */
  10158. drag: false,
  10159. /**
  10160. * @description Whether to enable hover
  10161. * @type {Boolean}
  10162. * @default hover = false
  10163. */
  10164. hover: false,
  10165. /**
  10166. * @description Graph rendering index
  10167. * Give priority to index high graph in rendering
  10168. * @type {Number}
  10169. * @example index = 1
  10170. */
  10171. index: 1,
  10172. /**
  10173. * @description Animation delay time(ms)
  10174. * @type {Number}
  10175. * @default animationDelay = 0
  10176. */
  10177. animationDelay: 0,
  10178. /**
  10179. * @description Number of animation frames
  10180. * @type {Number}
  10181. * @default animationFrame = 30
  10182. */
  10183. animationFrame: 30,
  10184. /**
  10185. * @description Animation dynamic curve (Supported by transition)
  10186. * @type {String}
  10187. * @default animationCurve = 'linear'
  10188. * @link https://github.com/jiaming743/Transition
  10189. */
  10190. animationCurve: 'linear',
  10191. /**
  10192. * @description Weather to pause graph animation
  10193. * @type {Boolean}
  10194. * @default animationPause = false
  10195. */
  10196. animationPause: false,
  10197. /**
  10198. * @description Rectangular hover detection zone
  10199. * Use this method for hover detection first
  10200. * @type {Null|Array}
  10201. * @default hoverRect = null
  10202. * @example hoverRect = [0, 0, 100, 100] // [Rect start x, y, Rect width, height]
  10203. */
  10204. hoverRect: null,
  10205. /**
  10206. * @description Mouse enter event handler
  10207. * @type {Function|Null}
  10208. * @default mouseEnter = null
  10209. */
  10210. mouseEnter: null,
  10211. /**
  10212. * @description Mouse outer event handler
  10213. * @type {Function|Null}
  10214. * @default mouseOuter = null
  10215. */
  10216. mouseOuter: null,
  10217. /**
  10218. * @description Mouse click event handler
  10219. * @type {Function|Null}
  10220. * @default click = null
  10221. */
  10222. click: null
  10223. };
  10224. var configAbleNot = {
  10225. status: 'static',
  10226. animationRoot: [],
  10227. animationKeys: [],
  10228. animationFrameState: [],
  10229. cache: {}
  10230. };
  10231. if (!config.shape) config.shape = {};
  10232. if (!config.style) config.style = {};
  10233. var shape = Object.assign({}, graph.shape, config.shape);
  10234. Object.assign(defaultConfig, config, configAbleNot);
  10235. Object.assign(this, graph, defaultConfig);
  10236. this.shape = shape;
  10237. this.style = new _style["default"](config.style);
  10238. this.addedProcessor();
  10239. };
  10240. /**
  10241. * @description Processor of added
  10242. * @return {Undefined} Void
  10243. */
  10244. exports["default"] = Graph;
  10245. Graph.prototype.addedProcessor = function () {
  10246. if (typeof this.setGraphCenter === 'function') this.setGraphCenter(null, this); // The life cycle 'added"
  10247. if (typeof this.added === 'function') this.added(this);
  10248. };
  10249. /**
  10250. * @description Processor of draw
  10251. * @param {CRender} render Instance of CRender
  10252. * @param {Graph} graph Instance of Graph
  10253. * @return {Undefined} Void
  10254. */
  10255. Graph.prototype.drawProcessor = function (render, graph) {
  10256. var ctx = render.ctx;
  10257. graph.style.initStyle(ctx);
  10258. if (typeof this.beforeDraw === 'function') this.beforeDraw(this, render);
  10259. graph.draw(render, graph);
  10260. if (typeof this.drawed === 'function') this.drawed(this, render);
  10261. graph.style.restoreTransform(ctx);
  10262. };
  10263. /**
  10264. * @description Processor of hover check
  10265. * @param {Array} position Mouse Position
  10266. * @param {Graph} graph Instance of Graph
  10267. * @return {Boolean} Result of hover check
  10268. */
  10269. Graph.prototype.hoverCheckProcessor = function (position, _ref) {
  10270. var hoverRect = _ref.hoverRect,
  10271. style = _ref.style,
  10272. hoverCheck = _ref.hoverCheck;
  10273. var graphCenter = style.graphCenter,
  10274. rotate = style.rotate,
  10275. scale = style.scale,
  10276. translate = style.translate;
  10277. if (graphCenter) {
  10278. if (rotate) position = (0, util.getRotatePointPos)(-rotate, position, graphCenter);
  10279. if (scale) position = (0, util.getScalePointPos)(scale.map(function (s) {
  10280. return 1 / s;
  10281. }), position, graphCenter);
  10282. if (translate) position = (0, util.getTranslatePointPos)(translate.map(function (v) {
  10283. return v * -1;
  10284. }), position);
  10285. }
  10286. if (hoverRect) return util.checkPointIsInRect.apply(void 0, [position].concat((0, _toConsumableArray2["default"])(hoverRect)));
  10287. return hoverCheck(position, this);
  10288. };
  10289. /**
  10290. * @description Processor of move
  10291. * @param {Event} e Mouse movement event
  10292. * @return {Undefined} Void
  10293. */
  10294. Graph.prototype.moveProcessor = function (e) {
  10295. this.move(e, this);
  10296. if (typeof this.beforeMove === 'function') this.beforeMove(e, this);
  10297. if (typeof this.setGraphCenter === 'function') this.setGraphCenter(e, this);
  10298. if (typeof this.moved === 'function') this.moved(e, this);
  10299. };
  10300. /**
  10301. * @description Update graph state
  10302. * @param {String} attrName Updated attribute name
  10303. * @param {Any} change Updated value
  10304. * @return {Undefined} Void
  10305. */
  10306. Graph.prototype.attr = function (attrName) {
  10307. var change = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  10308. if (!attrName || change === undefined) return false;
  10309. var isObject = (0, _typeof2["default"])(this[attrName]) === 'object';
  10310. if (isObject) change = (0, util.deepClone)(change, true);
  10311. var render = this.render;
  10312. if (attrName === 'style') {
  10313. this.style.update(change);
  10314. } else if (isObject) {
  10315. Object.assign(this[attrName], change);
  10316. } else {
  10317. this[attrName] = change;
  10318. }
  10319. if (attrName === 'index') render.sortGraphsByIndex();
  10320. render.drawAllGraph();
  10321. };
  10322. /**
  10323. * @description Update graphics state (with animation)
  10324. * Only shape and style attributes are supported
  10325. * @param {String} attrName Updated attribute name
  10326. * @param {Any} change Updated value
  10327. * @param {Boolean} wait Whether to store the animation waiting
  10328. * for the next animation request
  10329. * @return {Promise} Animation Promise
  10330. */
  10331. Graph.prototype.animation =
  10332. /*#__PURE__*/
  10333. function () {
  10334. var _ref2 = (0, _asyncToGenerator2["default"])(
  10335. /*#__PURE__*/
  10336. _regenerator["default"].mark(function _callee2(attrName, change) {
  10337. var wait,
  10338. changeRoot,
  10339. changeKeys,
  10340. beforeState,
  10341. animationFrame,
  10342. animationCurve,
  10343. animationDelay,
  10344. animationFrameState,
  10345. render,
  10346. _args2 = arguments;
  10347. return _regenerator["default"].wrap(function _callee2$(_context2) {
  10348. while (1) {
  10349. switch (_context2.prev = _context2.next) {
  10350. case 0:
  10351. wait = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : false;
  10352. if (!(attrName !== 'shape' && attrName !== 'style')) {
  10353. _context2.next = 4;
  10354. break;
  10355. }
  10356. console.error('Only supported shape and style animation!');
  10357. return _context2.abrupt("return");
  10358. case 4:
  10359. change = (0, util.deepClone)(change, true);
  10360. if (attrName === 'style') this.style.colorProcessor(change);
  10361. changeRoot = this[attrName];
  10362. changeKeys = Object.keys(change);
  10363. beforeState = {};
  10364. changeKeys.forEach(function (key) {
  10365. return beforeState[key] = changeRoot[key];
  10366. });
  10367. animationFrame = this.animationFrame, animationCurve = this.animationCurve, animationDelay = this.animationDelay;
  10368. animationFrameState = (0, _transition["default"])(animationCurve, beforeState, change, animationFrame, true);
  10369. this.animationRoot.push(changeRoot);
  10370. this.animationKeys.push(changeKeys);
  10371. this.animationFrameState.push(animationFrameState);
  10372. if (!wait) {
  10373. _context2.next = 17;
  10374. break;
  10375. }
  10376. return _context2.abrupt("return");
  10377. case 17:
  10378. if (!(animationDelay > 0)) {
  10379. _context2.next = 20;
  10380. break;
  10381. }
  10382. _context2.next = 20;
  10383. return delay(animationDelay);
  10384. case 20:
  10385. render = this.render;
  10386. return _context2.abrupt("return", new Promise(
  10387. /*#__PURE__*/
  10388. function () {
  10389. var _ref3 = (0, _asyncToGenerator2["default"])(
  10390. /*#__PURE__*/
  10391. _regenerator["default"].mark(function _callee(resolve) {
  10392. return _regenerator["default"].wrap(function _callee$(_context) {
  10393. while (1) {
  10394. switch (_context.prev = _context.next) {
  10395. case 0:
  10396. _context.next = 2;
  10397. return render.launchAnimation();
  10398. case 2:
  10399. resolve();
  10400. case 3:
  10401. case "end":
  10402. return _context.stop();
  10403. }
  10404. }
  10405. }, _callee);
  10406. }));
  10407. return function (_x3) {
  10408. return _ref3.apply(this, arguments);
  10409. };
  10410. }()));
  10411. case 22:
  10412. case "end":
  10413. return _context2.stop();
  10414. }
  10415. }
  10416. }, _callee2, this);
  10417. }));
  10418. return function (_x, _x2) {
  10419. return _ref2.apply(this, arguments);
  10420. };
  10421. }();
  10422. /**
  10423. * @description Extract the next frame of data from the animation queue
  10424. * and update the graph state
  10425. * @return {Undefined} Void
  10426. */
  10427. Graph.prototype.turnNextAnimationFrame = function (timeStamp) {
  10428. var animationDelay = this.animationDelay,
  10429. animationRoot = this.animationRoot,
  10430. animationKeys = this.animationKeys,
  10431. animationFrameState = this.animationFrameState,
  10432. animationPause = this.animationPause;
  10433. if (animationPause) return;
  10434. if (Date.now() - timeStamp < animationDelay) return;
  10435. animationRoot.forEach(function (root, i) {
  10436. animationKeys[i].forEach(function (key) {
  10437. root[key] = animationFrameState[i][0][key];
  10438. });
  10439. });
  10440. animationFrameState.forEach(function (stateItem, i) {
  10441. stateItem.shift();
  10442. var noFrame = stateItem.length === 0;
  10443. if (noFrame) animationRoot[i] = null;
  10444. if (noFrame) animationKeys[i] = null;
  10445. });
  10446. this.animationFrameState = animationFrameState.filter(function (state) {
  10447. return state.length;
  10448. });
  10449. this.animationRoot = animationRoot.filter(function (root) {
  10450. return root;
  10451. });
  10452. this.animationKeys = animationKeys.filter(function (keys) {
  10453. return keys;
  10454. });
  10455. };
  10456. /**
  10457. * @description Skip to the last frame of animation
  10458. * @return {Undefined} Void
  10459. */
  10460. Graph.prototype.animationEnd = function () {
  10461. var animationFrameState = this.animationFrameState,
  10462. animationKeys = this.animationKeys,
  10463. animationRoot = this.animationRoot,
  10464. render = this.render;
  10465. animationRoot.forEach(function (root, i) {
  10466. var currentKeys = animationKeys[i];
  10467. var lastState = animationFrameState[i].pop();
  10468. currentKeys.forEach(function (key) {
  10469. return root[key] = lastState[key];
  10470. });
  10471. });
  10472. this.animationFrameState = [];
  10473. this.animationKeys = [];
  10474. this.animationRoot = [];
  10475. return render.drawAllGraph();
  10476. };
  10477. /**
  10478. * @description Pause animation behavior
  10479. * @return {Undefined} Void
  10480. */
  10481. Graph.prototype.pauseAnimation = function () {
  10482. this.attr('animationPause', true);
  10483. };
  10484. /**
  10485. * @description Try animation behavior
  10486. * @return {Undefined} Void
  10487. */
  10488. Graph.prototype.playAnimation = function () {
  10489. var render = this.render;
  10490. this.attr('animationPause', false);
  10491. return new Promise(
  10492. /*#__PURE__*/
  10493. function () {
  10494. var _ref4 = (0, _asyncToGenerator2["default"])(
  10495. /*#__PURE__*/
  10496. _regenerator["default"].mark(function _callee3(resolve) {
  10497. return _regenerator["default"].wrap(function _callee3$(_context3) {
  10498. while (1) {
  10499. switch (_context3.prev = _context3.next) {
  10500. case 0:
  10501. _context3.next = 2;
  10502. return render.launchAnimation();
  10503. case 2:
  10504. resolve();
  10505. case 3:
  10506. case "end":
  10507. return _context3.stop();
  10508. }
  10509. }
  10510. }, _callee3);
  10511. }));
  10512. return function (_x4) {
  10513. return _ref4.apply(this, arguments);
  10514. };
  10515. }());
  10516. };
  10517. /**
  10518. * @description Processor of delete
  10519. * @param {CRender} render Instance of CRender
  10520. * @return {Undefined} Void
  10521. */
  10522. Graph.prototype.delProcessor = function (render) {
  10523. var _this = this;
  10524. var graphs = render.graphs;
  10525. var index = graphs.findIndex(function (graph) {
  10526. return graph === _this;
  10527. });
  10528. if (index === -1) return;
  10529. if (typeof this.beforeDelete === 'function') this.beforeDelete(this);
  10530. graphs.splice(index, 1, null);
  10531. if (typeof this.deleted === 'function') this.deleted(this);
  10532. };
  10533. /**
  10534. * @description Return a timed release Promise
  10535. * @param {Number} time Release time
  10536. * @return {Promise} A timed release Promise
  10537. */
  10538. function delay(time) {
  10539. return new Promise(function (resolve) {
  10540. setTimeout(resolve, time);
  10541. });
  10542. }
  10543. });
  10544. unwrapExports(graph_class);
  10545. var crender_class = createCommonjsModule(function (module, exports) {
  10546. Object.defineProperty(exports, "__esModule", {
  10547. value: true
  10548. });
  10549. exports["default"] = void 0;
  10550. var _defineProperty2 = interopRequireDefault(defineProperty);
  10551. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  10552. var _classCallCheck2 = interopRequireDefault(classCallCheck);
  10553. var _color = interopRequireDefault(lib);
  10554. var _bezierCurve = interopRequireDefault(lib$1);
  10555. var _graphs = interopRequireDefault(graphs_1);
  10556. var _graph = interopRequireDefault(graph_class);
  10557. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  10558. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  10559. /**
  10560. * @description Class of CRender
  10561. * @param {Object} canvas Canvas DOM
  10562. * @return {CRender} Instance of CRender
  10563. */
  10564. var CRender = function CRender(canvas) {
  10565. (0, _classCallCheck2["default"])(this, CRender);
  10566. if (!canvas) {
  10567. console.error('CRender Missing parameters!');
  10568. return;
  10569. }
  10570. var ctx = canvas.getContext('2d');
  10571. var clientWidth = canvas.clientWidth,
  10572. clientHeight = canvas.clientHeight;
  10573. var area = [clientWidth, clientHeight];
  10574. canvas.setAttribute('width', clientWidth);
  10575. canvas.setAttribute('height', clientHeight);
  10576. /**
  10577. * @description Context of the canvas
  10578. * @type {Object}
  10579. * @example ctx = canvas.getContext('2d')
  10580. */
  10581. this.ctx = ctx;
  10582. /**
  10583. * @description Width and height of the canvas
  10584. * @type {Array}
  10585. * @example area = [300,100]
  10586. */
  10587. this.area = area;
  10588. /**
  10589. * @description Whether render is in animation rendering
  10590. * @type {Boolean}
  10591. * @example animationStatus = true|false
  10592. */
  10593. this.animationStatus = false;
  10594. /**
  10595. * @description Added graph
  10596. * @type {[Graph]}
  10597. * @example graphs = [Graph, Graph, ...]
  10598. */
  10599. this.graphs = [];
  10600. /**
  10601. * @description Color plugin
  10602. * @type {Object}
  10603. * @link https://github.com/jiaming743/color
  10604. */
  10605. this.color = _color["default"];
  10606. /**
  10607. * @description Bezier Curve plugin
  10608. * @type {Object}
  10609. * @link https://github.com/jiaming743/BezierCurve
  10610. */
  10611. this.bezierCurve = _bezierCurve["default"]; // bind event handler
  10612. canvas.addEventListener('mousedown', mouseDown.bind(this));
  10613. canvas.addEventListener('mousemove', mouseMove.bind(this));
  10614. canvas.addEventListener('mouseup', mouseUp.bind(this));
  10615. };
  10616. /**
  10617. * @description Clear canvas drawing area
  10618. * @return {Undefined} Void
  10619. */
  10620. exports["default"] = CRender;
  10621. CRender.prototype.clearArea = function () {
  10622. var _this$ctx;
  10623. var area = this.area;
  10624. (_this$ctx = this.ctx).clearRect.apply(_this$ctx, [0, 0].concat((0, _toConsumableArray2["default"])(area)));
  10625. };
  10626. /**
  10627. * @description Add graph to render
  10628. * @param {Object} config Graph configuration
  10629. * @return {Graph} Graph instance
  10630. */
  10631. CRender.prototype.add = function () {
  10632. var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10633. var name = config.name;
  10634. if (!name) {
  10635. console.error('add Missing parameters!');
  10636. return;
  10637. }
  10638. var graphConfig = _graphs["default"].get(name);
  10639. if (!graphConfig) {
  10640. console.warn('No corresponding graph configuration found!');
  10641. return;
  10642. }
  10643. var graph = new _graph["default"](graphConfig, config);
  10644. if (!graph.validator(graph)) return;
  10645. graph.render = this;
  10646. this.graphs.push(graph);
  10647. this.sortGraphsByIndex();
  10648. this.drawAllGraph();
  10649. return graph;
  10650. };
  10651. /**
  10652. * @description Sort the graph by index
  10653. * @return {Undefined} Void
  10654. */
  10655. CRender.prototype.sortGraphsByIndex = function () {
  10656. var graphs = this.graphs;
  10657. graphs.sort(function (a, b) {
  10658. if (a.index > b.index) return 1;
  10659. if (a.index === b.index) return 0;
  10660. if (a.index < b.index) return -1;
  10661. });
  10662. };
  10663. /**
  10664. * @description Delete graph in render
  10665. * @param {Graph} graph The graph to be deleted
  10666. * @return {Undefined} Void
  10667. */
  10668. CRender.prototype.delGraph = function (graph) {
  10669. if (typeof graph.delProcessor !== 'function') return;
  10670. graph.delProcessor(this);
  10671. this.graphs = this.graphs.filter(function (graph) {
  10672. return graph;
  10673. });
  10674. this.drawAllGraph();
  10675. };
  10676. /**
  10677. * @description Delete all graph in render
  10678. * @return {Undefined} Void
  10679. */
  10680. CRender.prototype.delAllGraph = function () {
  10681. var _this = this;
  10682. this.graphs.forEach(function (graph) {
  10683. return graph.delProcessor(_this);
  10684. });
  10685. this.graphs = this.graphs.filter(function (graph) {
  10686. return graph;
  10687. });
  10688. this.drawAllGraph();
  10689. };
  10690. /**
  10691. * @description Draw all the graphs in the render
  10692. * @return {Undefined} Void
  10693. */
  10694. CRender.prototype.drawAllGraph = function () {
  10695. var _this2 = this;
  10696. this.clearArea();
  10697. this.graphs.filter(function (graph) {
  10698. return graph && graph.visible;
  10699. }).forEach(function (graph) {
  10700. return graph.drawProcessor(_this2, graph);
  10701. });
  10702. };
  10703. /**
  10704. * @description Animate the graph whose animation queue is not empty
  10705. * and the animationPause is equal to false
  10706. * @return {Promise} Animation Promise
  10707. */
  10708. CRender.prototype.launchAnimation = function () {
  10709. var _this3 = this;
  10710. var animationStatus = this.animationStatus;
  10711. if (animationStatus) return;
  10712. this.animationStatus = true;
  10713. return new Promise(function (resolve) {
  10714. animation.call(_this3, function () {
  10715. _this3.animationStatus = false;
  10716. resolve();
  10717. }, Date.now());
  10718. });
  10719. };
  10720. /**
  10721. * @description Try to animate every graph
  10722. * @param {Function} callback Callback in animation end
  10723. * @param {Number} timeStamp Time stamp of animation start
  10724. * @return {Undefined} Void
  10725. */
  10726. function animation(callback, timeStamp) {
  10727. var graphs = this.graphs;
  10728. if (!animationAble(graphs)) {
  10729. callback();
  10730. return;
  10731. }
  10732. graphs.forEach(function (graph) {
  10733. return graph.turnNextAnimationFrame(timeStamp);
  10734. });
  10735. this.drawAllGraph();
  10736. requestAnimationFrame(animation.bind(this, callback, timeStamp));
  10737. }
  10738. /**
  10739. * @description Find if there are graph that can be animated
  10740. * @param {[Graph]} graphs
  10741. * @return {Boolean}
  10742. */
  10743. function animationAble(graphs) {
  10744. return graphs.find(function (graph) {
  10745. return !graph.animationPause && graph.animationFrameState.length;
  10746. });
  10747. }
  10748. /**
  10749. * @description Handler of CRender mousedown event
  10750. * @return {Undefined} Void
  10751. */
  10752. function mouseDown(e) {
  10753. var graphs = this.graphs;
  10754. var hoverGraph = graphs.find(function (graph) {
  10755. return graph.status === 'hover';
  10756. });
  10757. if (!hoverGraph) return;
  10758. hoverGraph.status = 'active';
  10759. }
  10760. /**
  10761. * @description Handler of CRender mousemove event
  10762. * @return {Undefined} Void
  10763. */
  10764. function mouseMove(e) {
  10765. var offsetX = e.offsetX,
  10766. offsetY = e.offsetY;
  10767. var position = [offsetX, offsetY];
  10768. var graphs = this.graphs;
  10769. var activeGraph = graphs.find(function (graph) {
  10770. return graph.status === 'active' || graph.status === 'drag';
  10771. });
  10772. if (activeGraph) {
  10773. if (!activeGraph.drag) return;
  10774. if (typeof activeGraph.move !== 'function') {
  10775. console.error('No move method is provided, cannot be dragged!');
  10776. return;
  10777. }
  10778. activeGraph.moveProcessor(e);
  10779. activeGraph.status = 'drag';
  10780. return;
  10781. }
  10782. var hoverGraph = graphs.find(function (graph) {
  10783. return graph.status === 'hover';
  10784. });
  10785. var hoverAbleGraphs = graphs.filter(function (graph) {
  10786. return graph.hover && (typeof graph.hoverCheck === 'function' || graph.hoverRect);
  10787. });
  10788. var hoveredGraph = hoverAbleGraphs.find(function (graph) {
  10789. return graph.hoverCheckProcessor(position, graph);
  10790. });
  10791. if (hoveredGraph) {
  10792. document.body.style.cursor = hoveredGraph.style.hoverCursor;
  10793. } else {
  10794. document.body.style.cursor = 'default';
  10795. }
  10796. var hoverGraphMouseOuterIsFun = false,
  10797. hoveredGraphMouseEnterIsFun = false;
  10798. if (hoverGraph) hoverGraphMouseOuterIsFun = typeof hoverGraph.mouseOuter === 'function';
  10799. if (hoveredGraph) hoveredGraphMouseEnterIsFun = typeof hoveredGraph.mouseEnter === 'function';
  10800. if (!hoveredGraph && !hoverGraph) return;
  10801. if (!hoveredGraph && hoverGraph) {
  10802. if (hoverGraphMouseOuterIsFun) hoverGraph.mouseOuter(e, hoverGraph);
  10803. hoverGraph.status = 'static';
  10804. return;
  10805. }
  10806. if (hoveredGraph && hoveredGraph === hoverGraph) return;
  10807. if (hoveredGraph && !hoverGraph) {
  10808. if (hoveredGraphMouseEnterIsFun) hoveredGraph.mouseEnter(e, hoveredGraph);
  10809. hoveredGraph.status = 'hover';
  10810. return;
  10811. }
  10812. if (hoveredGraph && hoverGraph && hoveredGraph !== hoverGraph) {
  10813. if (hoverGraphMouseOuterIsFun) hoverGraph.mouseOuter(e, hoverGraph);
  10814. hoverGraph.status = 'static';
  10815. if (hoveredGraphMouseEnterIsFun) hoveredGraph.mouseEnter(e, hoveredGraph);
  10816. hoveredGraph.status = 'hover';
  10817. }
  10818. }
  10819. /**
  10820. * @description Handler of CRender mouseup event
  10821. * @return {Undefined} Void
  10822. */
  10823. function mouseUp(e) {
  10824. var graphs = this.graphs;
  10825. var activeGraph = graphs.find(function (graph) {
  10826. return graph.status === 'active';
  10827. });
  10828. var dragGraph = graphs.find(function (graph) {
  10829. return graph.status === 'drag';
  10830. });
  10831. if (activeGraph && typeof activeGraph.click === 'function') activeGraph.click(e, activeGraph);
  10832. graphs.forEach(function (graph) {
  10833. return graph && (graph.status = 'static');
  10834. });
  10835. if (activeGraph) activeGraph.status = 'hover';
  10836. if (dragGraph) dragGraph.status = 'hover';
  10837. }
  10838. /**
  10839. * @description Clone Graph
  10840. * @param {Graph} graph The target to be cloned
  10841. * @return {Graph} Cloned graph
  10842. */
  10843. CRender.prototype.clone = function (graph) {
  10844. var style = graph.style.getStyle();
  10845. var clonedGraph = _objectSpread({}, graph, {
  10846. style: style
  10847. });
  10848. delete clonedGraph.render;
  10849. clonedGraph = (0, util.deepClone)(clonedGraph, true);
  10850. return this.add(clonedGraph);
  10851. };
  10852. });
  10853. unwrapExports(crender_class);
  10854. var lib$3 = createCommonjsModule(function (module, exports) {
  10855. Object.defineProperty(exports, "__esModule", {
  10856. value: true
  10857. });
  10858. Object.defineProperty(exports, "CRender", {
  10859. enumerable: true,
  10860. get: function get() {
  10861. return _crender["default"];
  10862. }
  10863. });
  10864. Object.defineProperty(exports, "extendNewGraph", {
  10865. enumerable: true,
  10866. get: function get() {
  10867. return graphs_1.extendNewGraph;
  10868. }
  10869. });
  10870. exports["default"] = void 0;
  10871. var _crender = interopRequireDefault(crender_class);
  10872. var _default = _crender["default"];
  10873. exports["default"] = _default;
  10874. });
  10875. var CRender = unwrapExports(lib$3);
  10876. var _defineProperty2 = interopRequireDefault(defineProperty);
  10877. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  10878. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  10879. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  10880. var pie = {
  10881. shape: {
  10882. rx: 0,
  10883. ry: 0,
  10884. ir: 0,
  10885. or: 0,
  10886. startAngle: 0,
  10887. endAngle: 0,
  10888. clockWise: true
  10889. },
  10890. validator: function validator(_ref) {
  10891. var shape = _ref.shape;
  10892. var keys = ['rx', 'ry', 'ir', 'or', 'startAngle', 'endAngle'];
  10893. if (keys.find(function (key) {
  10894. return typeof shape[key] !== 'number';
  10895. })) {
  10896. console.error('Pie shape configuration is abnormal!');
  10897. return false;
  10898. }
  10899. return true;
  10900. },
  10901. draw: function draw(_ref2, _ref3) {
  10902. var ctx = _ref2.ctx;
  10903. var shape = _ref3.shape;
  10904. ctx.beginPath();
  10905. var rx = shape.rx,
  10906. ry = shape.ry,
  10907. ir = shape.ir,
  10908. or = shape.or,
  10909. startAngle = shape.startAngle,
  10910. endAngle = shape.endAngle,
  10911. clockWise = shape.clockWise;
  10912. rx = parseInt(rx) + 0.5;
  10913. ry = parseInt(ry) + 0.5;
  10914. ctx.arc(rx, ry, ir > 0 ? ir : 0, startAngle, endAngle, !clockWise);
  10915. var connectPoint1 = (0, util.getCircleRadianPoint)(rx, ry, or, endAngle).map(function (p) {
  10916. return parseInt(p) + 0.5;
  10917. });
  10918. var connectPoint2 = (0, util.getCircleRadianPoint)(rx, ry, ir, startAngle).map(function (p) {
  10919. return parseInt(p) + 0.5;
  10920. });
  10921. ctx.lineTo.apply(ctx, (0, _toConsumableArray2["default"])(connectPoint1));
  10922. ctx.arc(rx, ry, or > 0 ? or : 0, endAngle, startAngle, clockWise);
  10923. ctx.lineTo.apply(ctx, (0, _toConsumableArray2["default"])(connectPoint2));
  10924. ctx.closePath();
  10925. ctx.stroke();
  10926. ctx.fill();
  10927. }
  10928. };
  10929. var agArc = {
  10930. shape: {
  10931. rx: 0,
  10932. ry: 0,
  10933. r: 0,
  10934. startAngle: 0,
  10935. endAngle: 0,
  10936. gradientStartAngle: null,
  10937. gradientEndAngle: null
  10938. },
  10939. validator: function validator(_ref4) {
  10940. var shape = _ref4.shape;
  10941. var keys = ['rx', 'ry', 'r', 'startAngle', 'endAngle'];
  10942. if (keys.find(function (key) {
  10943. return typeof shape[key] !== 'number';
  10944. })) {
  10945. console.error('AgArc shape configuration is abnormal!');
  10946. return false;
  10947. }
  10948. return true;
  10949. },
  10950. draw: function draw(_ref5, _ref6) {
  10951. var ctx = _ref5.ctx;
  10952. var shape = _ref6.shape,
  10953. style = _ref6.style;
  10954. var gradient = style.gradient;
  10955. gradient = gradient.map(function (cv) {
  10956. return (0, lib.getColorFromRgbValue)(cv);
  10957. });
  10958. if (gradient.length === 1) {
  10959. gradient = [gradient[0], gradient[0]];
  10960. }
  10961. var gradientArcNum = gradient.length - 1;
  10962. var gradientStartAngle = shape.gradientStartAngle,
  10963. gradientEndAngle = shape.gradientEndAngle,
  10964. startAngle = shape.startAngle,
  10965. endAngle = shape.endAngle,
  10966. r = shape.r,
  10967. rx = shape.rx,
  10968. ry = shape.ry;
  10969. if (gradientStartAngle === null) gradientStartAngle = startAngle;
  10970. if (gradientEndAngle === null) gradientEndAngle = endAngle;
  10971. var angleGap = (gradientEndAngle - gradientStartAngle) / gradientArcNum;
  10972. if (angleGap === Math.PI * 2) angleGap = Math.PI * 2 - 0.001;
  10973. for (var i = 0; i < gradientArcNum; i++) {
  10974. ctx.beginPath();
  10975. var startPoint = (0, util.getCircleRadianPoint)(rx, ry, r, startAngle + angleGap * i);
  10976. var endPoint = (0, util.getCircleRadianPoint)(rx, ry, r, startAngle + angleGap * (i + 1));
  10977. var color = (0, util$1.getLinearGradientColor)(ctx, startPoint, endPoint, [gradient[i], gradient[i + 1]]);
  10978. var arcStartAngle = startAngle + angleGap * i;
  10979. var arcEndAngle = startAngle + angleGap * (i + 1);
  10980. var doBreak = false;
  10981. if (arcEndAngle > endAngle) {
  10982. arcEndAngle = endAngle;
  10983. doBreak = true;
  10984. }
  10985. ctx.arc(rx, ry, r, arcStartAngle, arcEndAngle);
  10986. ctx.strokeStyle = color;
  10987. ctx.stroke();
  10988. if (doBreak) break;
  10989. }
  10990. }
  10991. };
  10992. var numberText = {
  10993. shape: {
  10994. number: [],
  10995. content: '',
  10996. position: [0, 0],
  10997. toFixed: 0,
  10998. rowGap: 0,
  10999. formatter: null
  11000. },
  11001. validator: function validator(_ref7) {
  11002. var shape = _ref7.shape;
  11003. var number = shape.number,
  11004. content = shape.content,
  11005. position = shape.position;
  11006. if (!(number instanceof Array) || typeof content !== 'string' || !(position instanceof Array)) {
  11007. console.error('NumberText shape configuration is abnormal!');
  11008. return false;
  11009. }
  11010. return true;
  11011. },
  11012. draw: function draw(_ref8, _ref9) {
  11013. var ctx = _ref8.ctx;
  11014. var shape = _ref9.shape;
  11015. var number = shape.number,
  11016. content = shape.content,
  11017. toFixed = shape.toFixed,
  11018. rowGap = shape.rowGap,
  11019. formatter = shape.formatter;
  11020. var textSegments = content.split('{nt}');
  11021. var textString = '';
  11022. textSegments.forEach(function (t, i) {
  11023. var currentNumber = number[i] || '';
  11024. if (typeof currentNumber === 'number') {
  11025. currentNumber = currentNumber.toFixed(toFixed);
  11026. if (typeof formatter === 'function') currentNumber = formatter(currentNumber);
  11027. }
  11028. textString += t + (currentNumber || '');
  11029. });
  11030. graphs_1.text.draw({
  11031. ctx: ctx
  11032. }, {
  11033. shape: _objectSpread({}, shape, {
  11034. content: textString,
  11035. rowGap: rowGap
  11036. })
  11037. });
  11038. }
  11039. };
  11040. var lineIcon = {
  11041. shape: {
  11042. x: 0,
  11043. y: 0,
  11044. w: 0,
  11045. h: 0
  11046. },
  11047. validator: function validator(_ref10) {
  11048. var shape = _ref10.shape;
  11049. var x = shape.x,
  11050. y = shape.y,
  11051. w = shape.w,
  11052. h = shape.h;
  11053. if (typeof x !== 'number' || typeof y !== 'number' || typeof w !== 'number' || typeof h !== 'number') {
  11054. console.error('lineIcon shape configuration is abnormal!');
  11055. return false;
  11056. }
  11057. return true;
  11058. },
  11059. draw: function draw(_ref11, _ref12) {
  11060. var ctx = _ref11.ctx;
  11061. var shape = _ref12.shape;
  11062. ctx.beginPath();
  11063. var x = shape.x,
  11064. y = shape.y,
  11065. w = shape.w,
  11066. h = shape.h;
  11067. var halfH = h / 2;
  11068. ctx.strokeStyle = ctx.fillStyle;
  11069. ctx.moveTo(x, y + halfH);
  11070. ctx.lineTo(x + w, y + halfH);
  11071. ctx.lineWidth = 1;
  11072. ctx.stroke();
  11073. ctx.beginPath();
  11074. var radius = halfH - 5 * 2;
  11075. if (radius <= 0) radius = 3;
  11076. ctx.arc(x + w / 2, y + halfH, radius, 0, Math.PI * 2);
  11077. ctx.lineWidth = 5;
  11078. ctx.stroke();
  11079. ctx.fillStyle = '#fff';
  11080. ctx.fill();
  11081. },
  11082. hoverCheck: function hoverCheck(position, _ref13) {
  11083. var shape = _ref13.shape;
  11084. var x = shape.x,
  11085. y = shape.y,
  11086. w = shape.w,
  11087. h = shape.h;
  11088. return (0, util.checkPointIsInRect)(position, x, y, w, h);
  11089. },
  11090. setGraphCenter: function setGraphCenter(e, _ref14) {
  11091. var shape = _ref14.shape,
  11092. style = _ref14.style;
  11093. var x = shape.x,
  11094. y = shape.y,
  11095. w = shape.w,
  11096. h = shape.h;
  11097. style.graphCenter = [x + w / 2, y + h / 2];
  11098. }
  11099. };
  11100. (0, lib$3.extendNewGraph)('pie', pie);
  11101. (0, lib$3.extendNewGraph)('agArc', agArc);
  11102. (0, lib$3.extendNewGraph)('numberText', numberText);
  11103. (0, lib$3.extendNewGraph)('lineIcon', lineIcon);
  11104. var color = createCommonjsModule(function (module, exports) {
  11105. Object.defineProperty(exports, "__esModule", {
  11106. value: true
  11107. });
  11108. exports.colorConfig = void 0;
  11109. var colorConfig = ['#37a2da', '#32c5e9', '#67e0e3', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293', '#e062ae', '#e690d1', '#e7bcf3', '#9d96f5', '#8378ea', '#96bfff'];
  11110. exports.colorConfig = colorConfig;
  11111. });
  11112. unwrapExports(color);
  11113. var color_1 = color.colorConfig;
  11114. var grid = createCommonjsModule(function (module, exports) {
  11115. Object.defineProperty(exports, "__esModule", {
  11116. value: true
  11117. });
  11118. exports.gridConfig = void 0;
  11119. var gridConfig = {
  11120. /**
  11121. * @description Grid left margin
  11122. * @type {String|Number}
  11123. * @default left = '10%'
  11124. * @example left = '10%' | 10
  11125. */
  11126. left: '10%',
  11127. /**
  11128. * @description Grid right margin
  11129. * @type {String|Number}
  11130. * @default right = '10%'
  11131. * @example right = '10%' | 10
  11132. */
  11133. right: '10%',
  11134. /**
  11135. * @description Grid top margin
  11136. * @type {String|Number}
  11137. * @default top = 60
  11138. * @example top = '10%' | 60
  11139. */
  11140. top: 60,
  11141. /**
  11142. * @description Grid bottom margin
  11143. * @type {String|Number}
  11144. * @default bottom = 60
  11145. * @example bottom = '10%' | 60
  11146. */
  11147. bottom: 60,
  11148. /**
  11149. * @description Grid default style configuration
  11150. * @type {Object}
  11151. * @default style = {Configuration Of Class Style}
  11152. */
  11153. style: {
  11154. fill: 'rgba(0, 0, 0, 0)'
  11155. },
  11156. /**
  11157. * @description Grid render level
  11158. * Priority rendering high level
  11159. * @type {Number}
  11160. * @default rLevel = -30
  11161. */
  11162. rLevel: -30,
  11163. /**
  11164. * @description Grid animation curve
  11165. * @type {String}
  11166. * @default animationCurve = 'easeOutCubic'
  11167. */
  11168. animationCurve: 'easeOutCubic',
  11169. /**
  11170. * @description Grid animation frame
  11171. * @type {Number}
  11172. * @default animationFrame = 50
  11173. */
  11174. animationFrame: 30
  11175. };
  11176. exports.gridConfig = gridConfig;
  11177. });
  11178. unwrapExports(grid);
  11179. var grid_1 = grid.gridConfig;
  11180. var axis = createCommonjsModule(function (module, exports) {
  11181. Object.defineProperty(exports, "__esModule", {
  11182. value: true
  11183. });
  11184. exports.yAxisConfig = exports.xAxisConfig = void 0;
  11185. var xAxisConfig = {
  11186. /**
  11187. * @description Axis name
  11188. * @type {String}
  11189. * @default name = ''
  11190. */
  11191. name: '',
  11192. /**
  11193. * @description Whether to display this axis
  11194. * @type {Boolean}
  11195. * @default show = true
  11196. */
  11197. show: true,
  11198. /**
  11199. * @description Axis position
  11200. * @type {String}
  11201. * @default position = 'bottom'
  11202. * @example position = 'bottom' | 'top'
  11203. */
  11204. position: 'bottom',
  11205. /**
  11206. * @description Name gap
  11207. * @type {Number}
  11208. * @default nameGap = 15
  11209. */
  11210. nameGap: 15,
  11211. /**
  11212. * @description Name location
  11213. * @type {String}
  11214. * @default nameLocation = 'end'
  11215. * @example nameLocation = 'end' | 'center' | 'start'
  11216. */
  11217. nameLocation: 'end',
  11218. /**
  11219. * @description Name default style configuration
  11220. * @type {Object}
  11221. * @default style = {Configuration Of Class Style}
  11222. */
  11223. nameTextStyle: {
  11224. fill: '#333',
  11225. fontSize: 10
  11226. },
  11227. /**
  11228. * @description Axis min value
  11229. * @type {String|Number}
  11230. * @default min = '20%'
  11231. * @example min = '20%' | 0
  11232. */
  11233. min: '20%',
  11234. /**
  11235. * @description Axis max value
  11236. * @type {String|Number}
  11237. * @default max = '20%'
  11238. * @example max = '20%' | 0
  11239. */
  11240. max: '20%',
  11241. /**
  11242. * @description Axis value interval
  11243. * @type {Number}
  11244. * @default interval = null
  11245. * @example interval = 100
  11246. */
  11247. interval: null,
  11248. /**
  11249. * @description Min interval
  11250. * @type {Number}
  11251. * @default minInterval = null
  11252. * @example minInterval = 1
  11253. */
  11254. minInterval: null,
  11255. /**
  11256. * @description Max interval
  11257. * @type {Number}
  11258. * @default maxInterval = null
  11259. * @example maxInterval = 100
  11260. */
  11261. maxInterval: null,
  11262. /**
  11263. * @description Boundary gap
  11264. * @type {Boolean}
  11265. * @default boundaryGap = null
  11266. * @example boundaryGap = true
  11267. */
  11268. boundaryGap: null,
  11269. /**
  11270. * @description Axis split number
  11271. * @type {Number}
  11272. * @default splitNumber = 5
  11273. */
  11274. splitNumber: 5,
  11275. /**
  11276. * @description Axis line configuration
  11277. * @type {Object}
  11278. */
  11279. axisLine: {
  11280. /**
  11281. * @description Whether to display axis line
  11282. * @type {Boolean}
  11283. * @default show = true
  11284. */
  11285. show: true,
  11286. /**
  11287. * @description Axis line default style configuration
  11288. * @type {Object}
  11289. * @default style = {Configuration Of Class Style}
  11290. */
  11291. style: {
  11292. stroke: '#333',
  11293. lineWidth: 1
  11294. }
  11295. },
  11296. /**
  11297. * @description Axis tick configuration
  11298. * @type {Object}
  11299. */
  11300. axisTick: {
  11301. /**
  11302. * @description Whether to display axis tick
  11303. * @type {Boolean}
  11304. * @default show = true
  11305. */
  11306. show: true,
  11307. /**
  11308. * @description Axis tick default style configuration
  11309. * @type {Object}
  11310. * @default style = {Configuration Of Class Style}
  11311. */
  11312. style: {
  11313. stroke: '#333',
  11314. lineWidth: 1
  11315. }
  11316. },
  11317. /**
  11318. * @description Axis label configuration
  11319. * @type {Object}
  11320. */
  11321. axisLabel: {
  11322. /**
  11323. * @description Whether to display axis label
  11324. * @type {Boolean}
  11325. * @default show = true
  11326. */
  11327. show: true,
  11328. /**
  11329. * @description Axis label formatter
  11330. * @type {String|Function}
  11331. * @default formatter = null
  11332. * @example formatter = '{value}件'
  11333. * @example formatter = (dataItem) => (dataItem.value)
  11334. */
  11335. formatter: null,
  11336. /**
  11337. * @description Axis label default style configuration
  11338. * @type {Object}
  11339. * @default style = {Configuration Of Class Style}
  11340. */
  11341. style: {
  11342. fill: '#333',
  11343. fontSize: 10,
  11344. rotate: 0
  11345. }
  11346. },
  11347. /**
  11348. * @description Axis split line configuration
  11349. * @type {Object}
  11350. */
  11351. splitLine: {
  11352. /**
  11353. * @description Whether to display axis split line
  11354. * @type {Boolean}
  11355. * @default show = false
  11356. */
  11357. show: false,
  11358. /**
  11359. * @description Axis split line default style configuration
  11360. * @type {Object}
  11361. * @default style = {Configuration Of Class Style}
  11362. */
  11363. style: {
  11364. stroke: '#d4d4d4',
  11365. lineWidth: 1
  11366. }
  11367. },
  11368. /**
  11369. * @description X axis render level
  11370. * Priority rendering high level
  11371. * @type {Number}
  11372. * @default rLevel = -20
  11373. */
  11374. rLevel: -20,
  11375. /**
  11376. * @description X axis animation curve
  11377. * @type {String}
  11378. * @default animationCurve = 'easeOutCubic'
  11379. */
  11380. animationCurve: 'easeOutCubic',
  11381. /**
  11382. * @description X axis animation frame
  11383. * @type {Number}
  11384. * @default animationFrame = 50
  11385. */
  11386. animationFrame: 50
  11387. };
  11388. exports.xAxisConfig = xAxisConfig;
  11389. var yAxisConfig = {
  11390. /**
  11391. * @description Axis name
  11392. * @type {String}
  11393. * @default name = ''
  11394. */
  11395. name: '',
  11396. /**
  11397. * @description Whether to display this axis
  11398. * @type {Boolean}
  11399. * @default show = true
  11400. */
  11401. show: true,
  11402. /**
  11403. * @description Axis position
  11404. * @type {String}
  11405. * @default position = 'left'
  11406. * @example position = 'left' | 'right'
  11407. */
  11408. position: 'left',
  11409. /**
  11410. * @description Name gap
  11411. * @type {Number}
  11412. * @default nameGap = 15
  11413. */
  11414. nameGap: 15,
  11415. /**
  11416. * @description Name location
  11417. * @type {String}
  11418. * @default nameLocation = 'end'
  11419. * @example nameLocation = 'end' | 'center' | 'start'
  11420. */
  11421. nameLocation: 'end',
  11422. /**
  11423. * @description name default style configuration
  11424. * @type {Object}
  11425. * @default style = {Configuration Of Class Style}
  11426. */
  11427. nameTextStyle: {
  11428. fill: '#333',
  11429. fontSize: 10
  11430. },
  11431. /**
  11432. * @description Axis min value
  11433. * @type {String|Number}
  11434. * @default min = '20%'
  11435. * @example min = '20%' | 0
  11436. */
  11437. min: '20%',
  11438. /**
  11439. * @description Axis max value
  11440. * @type {String|Number}
  11441. * @default max = '20%'
  11442. * @example max = '20%' | 0
  11443. */
  11444. max: '20%',
  11445. /**
  11446. * @description Axis value interval
  11447. * @type {Number}
  11448. * @default interval = null
  11449. * @example interval = 100
  11450. */
  11451. interval: null,
  11452. /**
  11453. * @description Min interval
  11454. * @type {Number}
  11455. * @default minInterval = null
  11456. * @example minInterval = 1
  11457. */
  11458. minInterval: null,
  11459. /**
  11460. * @description Max interval
  11461. * @type {Number}
  11462. * @default maxInterval = null
  11463. * @example maxInterval = 100
  11464. */
  11465. maxInterval: null,
  11466. /**
  11467. * @description Boundary gap
  11468. * @type {Boolean}
  11469. * @default boundaryGap = null
  11470. * @example boundaryGap = true
  11471. */
  11472. boundaryGap: null,
  11473. /**
  11474. * @description Axis split number
  11475. * @type {Number}
  11476. * @default splitNumber = 5
  11477. */
  11478. splitNumber: 5,
  11479. /**
  11480. * @description Axis line configuration
  11481. * @type {Object}
  11482. */
  11483. axisLine: {
  11484. /**
  11485. * @description Whether to display axis line
  11486. * @type {Boolean}
  11487. * @default show = true
  11488. */
  11489. show: true,
  11490. /**
  11491. * @description Axis line default style configuration
  11492. * @type {Object}
  11493. * @default style = {Configuration Of Class Style}
  11494. */
  11495. style: {
  11496. stroke: '#333',
  11497. lineWidth: 1
  11498. }
  11499. },
  11500. /**
  11501. * @description Axis tick configuration
  11502. * @type {Object}
  11503. */
  11504. axisTick: {
  11505. /**
  11506. * @description Whether to display axis tick
  11507. * @type {Boolean}
  11508. * @default show = true
  11509. */
  11510. show: true,
  11511. /**
  11512. * @description Axis tick default style configuration
  11513. * @type {Object}
  11514. * @default style = {Configuration Of Class Style}
  11515. */
  11516. style: {
  11517. stroke: '#333',
  11518. lineWidth: 1
  11519. }
  11520. },
  11521. /**
  11522. * @description Axis label configuration
  11523. * @type {Object}
  11524. */
  11525. axisLabel: {
  11526. /**
  11527. * @description Whether to display axis label
  11528. * @type {Boolean}
  11529. * @default show = true
  11530. */
  11531. show: true,
  11532. /**
  11533. * @description Axis label formatter
  11534. * @type {String|Function}
  11535. * @default formatter = null
  11536. * @example formatter = '{value}件'
  11537. * @example formatter = (dataItem) => (dataItem.value)
  11538. */
  11539. formatter: null,
  11540. /**
  11541. * @description Axis label default style configuration
  11542. * @type {Object}
  11543. * @default style = {Configuration Of Class Style}
  11544. */
  11545. style: {
  11546. fill: '#333',
  11547. fontSize: 10,
  11548. rotate: 0
  11549. }
  11550. },
  11551. /**
  11552. * @description Axis split line configuration
  11553. * @type {Object}
  11554. */
  11555. splitLine: {
  11556. /**
  11557. * @description Whether to display axis split line
  11558. * @type {Boolean}
  11559. * @default show = true
  11560. */
  11561. show: true,
  11562. /**
  11563. * @description Axis split line default style configuration
  11564. * @type {Object}
  11565. * @default style = {Configuration Of Class Style}
  11566. */
  11567. style: {
  11568. stroke: '#d4d4d4',
  11569. lineWidth: 1
  11570. }
  11571. },
  11572. /**
  11573. * @description Y axis render level
  11574. * Priority rendering high level
  11575. * @type {Number}
  11576. * @default rLevel = -20
  11577. */
  11578. rLevel: -20,
  11579. /**
  11580. * @description Y axis animation curve
  11581. * @type {String}
  11582. * @default animationCurve = 'easeOutCubic'
  11583. */
  11584. animationCurve: 'easeOutCubic',
  11585. /**
  11586. * @description Y axis animation frame
  11587. * @type {Number}
  11588. * @default animationFrame = 50
  11589. */
  11590. animationFrame: 50
  11591. };
  11592. exports.yAxisConfig = yAxisConfig;
  11593. });
  11594. unwrapExports(axis);
  11595. var axis_1 = axis.yAxisConfig;
  11596. var axis_2 = axis.xAxisConfig;
  11597. var title = createCommonjsModule(function (module, exports) {
  11598. Object.defineProperty(exports, "__esModule", {
  11599. value: true
  11600. });
  11601. exports.titleConfig = void 0;
  11602. var titleConfig = {
  11603. /**
  11604. * @description Whether to display title
  11605. * @type {Boolean}
  11606. * @default show = true
  11607. */
  11608. show: true,
  11609. /**
  11610. * @description Title text
  11611. * @type {String}
  11612. * @default text = ''
  11613. */
  11614. text: '',
  11615. /**
  11616. * @description Title offset
  11617. * @type {Array}
  11618. * @default offset = [0, -20]
  11619. */
  11620. offset: [0, -20],
  11621. /**
  11622. * @description Title default style configuration
  11623. * @type {Object}
  11624. * @default style = {Configuration Of Class Style}
  11625. */
  11626. style: {
  11627. fill: '#333',
  11628. fontSize: 17,
  11629. fontWeight: 'bold',
  11630. textAlign: 'center',
  11631. textBaseline: 'bottom'
  11632. },
  11633. /**
  11634. * @description Title render level
  11635. * Priority rendering high level
  11636. * @type {Number}
  11637. * @default rLevel = 20
  11638. */
  11639. rLevel: 20,
  11640. /**
  11641. * @description Title animation curve
  11642. * @type {String}
  11643. * @default animationCurve = 'easeOutCubic'
  11644. */
  11645. animationCurve: 'easeOutCubic',
  11646. /**
  11647. * @description Title animation frame
  11648. * @type {Number}
  11649. * @default animationFrame = 50
  11650. */
  11651. animationFrame: 50
  11652. };
  11653. exports.titleConfig = titleConfig;
  11654. });
  11655. unwrapExports(title);
  11656. var title_1 = title.titleConfig;
  11657. var line = createCommonjsModule(function (module, exports) {
  11658. Object.defineProperty(exports, "__esModule", {
  11659. value: true
  11660. });
  11661. exports.lineConfig = void 0;
  11662. var lineConfig = {
  11663. /**
  11664. * @description Whether to display this line chart
  11665. * @type {Boolean}
  11666. * @default show = true
  11667. */
  11668. show: true,
  11669. /**
  11670. * @description Legend name
  11671. * @type {String}
  11672. * @default name = ''
  11673. */
  11674. name: '',
  11675. /**
  11676. * @description Data stacking
  11677. * The data value of the series element of the same stack
  11678. * will be superimposed (the latter value will be superimposed on the previous value)
  11679. * @type {String}
  11680. * @default stack = ''
  11681. */
  11682. stack: '',
  11683. /**
  11684. * @description Smooth line
  11685. * @type {Boolean}
  11686. * @default smooth = false
  11687. */
  11688. smooth: false,
  11689. /**
  11690. * @description Line x axis index
  11691. * @type {Number}
  11692. * @default xAxisIndex = 0
  11693. * @example xAxisIndex = 0 | 1
  11694. */
  11695. xAxisIndex: 0,
  11696. /**
  11697. * @description Line y axis index
  11698. * @type {Number}
  11699. * @default yAxisIndex = 0
  11700. * @example yAxisIndex = 0 | 1
  11701. */
  11702. yAxisIndex: 0,
  11703. /**
  11704. * @description Line chart data
  11705. * @type {Array}
  11706. * @default data = []
  11707. * @example data = [100, 200, 300]
  11708. */
  11709. data: [],
  11710. /**
  11711. * @description Line default style configuration
  11712. * @type {Object}
  11713. * @default style = {Configuration Of Class Style}
  11714. */
  11715. lineStyle: {
  11716. lineWidth: 1
  11717. },
  11718. /**
  11719. * @description Line point configuration
  11720. * @type {Object}
  11721. */
  11722. linePoint: {
  11723. /**
  11724. * @description Whether to display line point
  11725. * @type {Boolean}
  11726. * @default show = true
  11727. */
  11728. show: true,
  11729. /**
  11730. * @description Line point radius
  11731. * @type {Number}
  11732. * @default radius = 2
  11733. */
  11734. radius: 2,
  11735. /**
  11736. * @description Line point default style configuration
  11737. * @type {Object}
  11738. * @default style = {Configuration Of Class Style}
  11739. */
  11740. style: {
  11741. fill: '#fff',
  11742. lineWidth: 1
  11743. }
  11744. },
  11745. /**
  11746. * @description Line area configuration
  11747. * @type {Object}
  11748. */
  11749. lineArea: {
  11750. /**
  11751. * @description Whether to display line area
  11752. * @type {Boolean}
  11753. * @default show = false
  11754. */
  11755. show: false,
  11756. /**
  11757. * @description Line area gradient color (Hex|rgb|rgba)
  11758. * @type {Array}
  11759. * @default gradient = []
  11760. */
  11761. gradient: [],
  11762. /**
  11763. * @description Line area style default configuration
  11764. * @type {Object}
  11765. * @default style = {Configuration Of Class Style}
  11766. */
  11767. style: {
  11768. opacity: 0.5
  11769. }
  11770. },
  11771. /**
  11772. * @description Line label configuration
  11773. * @type {Object}
  11774. */
  11775. label: {
  11776. /**
  11777. * @description Whether to display line label
  11778. * @type {Boolean}
  11779. * @default show = false
  11780. */
  11781. show: false,
  11782. /**
  11783. * @description Line label position
  11784. * @type {String}
  11785. * @default position = 'top'
  11786. * @example position = 'top' | 'center' | 'bottom'
  11787. */
  11788. position: 'top',
  11789. /**
  11790. * @description Line label offset
  11791. * @type {Array}
  11792. * @default offset = [0, -10]
  11793. */
  11794. offset: [0, -10],
  11795. /**
  11796. * @description Line label formatter
  11797. * @type {String|Function}
  11798. * @default formatter = null
  11799. * @example formatter = '{value}件'
  11800. * @example formatter = (dataItem) => (dataItem.value)
  11801. */
  11802. formatter: null,
  11803. /**
  11804. * @description Line label default style configuration
  11805. * @type {Object}
  11806. * @default style = {Configuration Of Class Style}
  11807. */
  11808. style: {
  11809. fontSize: 10
  11810. }
  11811. },
  11812. /**
  11813. * @description Line chart render level
  11814. * Priority rendering high level
  11815. * @type {Number}
  11816. * @default rLevel = 10
  11817. */
  11818. rLevel: 10,
  11819. /**
  11820. * @description Line animation curve
  11821. * @type {String}
  11822. * @default animationCurve = 'easeOutCubic'
  11823. */
  11824. animationCurve: 'easeOutCubic',
  11825. /**
  11826. * @description Line animation frame
  11827. * @type {Number}
  11828. * @default animationFrame = 50
  11829. */
  11830. animationFrame: 50
  11831. };
  11832. exports.lineConfig = lineConfig;
  11833. });
  11834. unwrapExports(line);
  11835. var line_1 = line.lineConfig;
  11836. var bar = createCommonjsModule(function (module, exports) {
  11837. Object.defineProperty(exports, "__esModule", {
  11838. value: true
  11839. });
  11840. exports.barConfig = void 0;
  11841. var barConfig = {
  11842. /**
  11843. * @description Whether to display this bar chart
  11844. * @type {Boolean}
  11845. * @default show = true
  11846. */
  11847. show: true,
  11848. /**
  11849. * @description Legend name
  11850. * @type {String}
  11851. * @default name = ''
  11852. */
  11853. name: '',
  11854. /**
  11855. * @description Data stacking
  11856. * The data value of the series element of the same stack
  11857. * will be superimposed (the latter value will be superimposed on the previous value)
  11858. * @type {String}
  11859. * @default stack = ''
  11860. */
  11861. stack: '',
  11862. /**
  11863. * @description Bar shape type
  11864. * @type {String}
  11865. * @default shapeType = 'normal'
  11866. * @example shapeType = 'normal' | 'leftEchelon' | 'rightEchelon'
  11867. */
  11868. shapeType: 'normal',
  11869. /**
  11870. * @description Echelon bar sharpness offset
  11871. * @type {Number}
  11872. * @default echelonOffset = 10
  11873. */
  11874. echelonOffset: 10,
  11875. /**
  11876. * @description Bar width
  11877. * This property should be set on the last 'bar' series
  11878. * in this coordinate system to take effect and will be in effect
  11879. * for all 'bar' series in this coordinate system
  11880. * @type {String|Number}
  11881. * @default barWidth = 'auto'
  11882. * @example barWidth = 'auto' | '10%' | 20
  11883. */
  11884. barWidth: 'auto',
  11885. /**
  11886. * @description Bar gap
  11887. * This property should be set on the last 'bar' series
  11888. * in this coordinate system to take effect and will be in effect
  11889. * for all 'bar' series in this coordinate system
  11890. * @type {String|Number}
  11891. * @default barGap = '30%'
  11892. * @example barGap = '30%' | 30
  11893. */
  11894. barGap: '30%',
  11895. /**
  11896. * @description Bar category gap
  11897. * This property should be set on the last 'bar' series
  11898. * in this coordinate system to take effect and will be in effect
  11899. * for all 'bar' series in this coordinate system
  11900. * @type {String|Number}
  11901. * @default barCategoryGap = '20%'
  11902. * @example barCategoryGap = '20%' | 20
  11903. */
  11904. barCategoryGap: '20%',
  11905. /**
  11906. * @description Bar x axis index
  11907. * @type {Number}
  11908. * @default xAxisIndex = 0
  11909. * @example xAxisIndex = 0 | 1
  11910. */
  11911. xAxisIndex: 0,
  11912. /**
  11913. * @description Bar y axis index
  11914. * @type {Number}
  11915. * @default yAxisIndex = 0
  11916. * @example yAxisIndex = 0 | 1
  11917. */
  11918. yAxisIndex: 0,
  11919. /**
  11920. * @description Bar chart data
  11921. * @type {Array}
  11922. * @default data = []
  11923. * @example data = [100, 200, 300]
  11924. */
  11925. data: [],
  11926. /**
  11927. * @description Background bar configuration
  11928. * @type {Object}
  11929. */
  11930. backgroundBar: {
  11931. /**
  11932. * @description Whether to display background bar
  11933. * @type {Boolean}
  11934. * @default show = false
  11935. */
  11936. show: false,
  11937. /**
  11938. * @description Background bar width
  11939. * @type {String|Number}
  11940. * @default width = 'auto'
  11941. * @example width = 'auto' | '30%' | 30
  11942. */
  11943. width: 'auto',
  11944. /**
  11945. * @description Background bar default style configuration
  11946. * @type {Object}
  11947. * @default style = {Configuration Of Class Style}
  11948. */
  11949. style: {
  11950. fill: 'rgba(200, 200, 200, .4)'
  11951. }
  11952. },
  11953. /**
  11954. * @description Bar label configuration
  11955. * @type {Object}
  11956. */
  11957. label: {
  11958. /**
  11959. * @description Whether to display bar label
  11960. * @type {Boolean}
  11961. * @default show = false
  11962. */
  11963. show: false,
  11964. /**
  11965. * @description Bar label position
  11966. * @type {String}
  11967. * @default position = 'top'
  11968. * @example position = 'top' | 'center' | 'bottom'
  11969. */
  11970. position: 'top',
  11971. /**
  11972. * @description Bar label offset
  11973. * @type {Array}
  11974. * @default offset = [0, -10]
  11975. */
  11976. offset: [0, -10],
  11977. /**
  11978. * @description Bar label formatter
  11979. * @type {String|Function}
  11980. * @default formatter = null
  11981. * @example formatter = '{value}件'
  11982. * @example formatter = (dataItem) => (dataItem.value)
  11983. */
  11984. formatter: null,
  11985. /**
  11986. * @description Bar label default style configuration
  11987. * @type {Object}
  11988. * @default style = {Configuration Of Class Style}
  11989. */
  11990. style: {
  11991. fontSize: 10
  11992. }
  11993. },
  11994. /**
  11995. * @description Bar gradient configuration
  11996. * @type {Object}
  11997. */
  11998. gradient: {
  11999. /**
  12000. * @description Gradient color (Hex|rgb|rgba)
  12001. * @type {Array}
  12002. * @default color = []
  12003. */
  12004. color: [],
  12005. /**
  12006. * @description Local gradient
  12007. * @type {Boolean}
  12008. * @default local = true
  12009. */
  12010. local: true
  12011. },
  12012. /**
  12013. * @description Bar style default configuration
  12014. * @type {Object}
  12015. * @default style = {Configuration Of Class Style}
  12016. */
  12017. barStyle: {},
  12018. /**
  12019. * @description Independent color mode
  12020. * When set to true, independent color mode is enabled
  12021. * @type {Boolean}
  12022. * @default independentColor = false
  12023. */
  12024. independentColor: false,
  12025. /**
  12026. * @description Independent colors
  12027. * Only effective when independent color mode is enabled
  12028. * Default value is the same as the color in the root configuration
  12029. * Two-dimensional color array can produce gradient colors
  12030. * @type {Array}
  12031. * @example independentColor = ['#fff', '#000']
  12032. * @example independentColor = [['#fff', '#000'], '#000']
  12033. */
  12034. independentColors: [],
  12035. /**
  12036. * @description Bar chart render level
  12037. * Priority rendering high level
  12038. * @type {Number}
  12039. * @default rLevel = 0
  12040. */
  12041. rLevel: 0,
  12042. /**
  12043. * @description Bar animation curve
  12044. * @type {String}
  12045. * @default animationCurve = 'easeOutCubic'
  12046. */
  12047. animationCurve: 'easeOutCubic',
  12048. /**
  12049. * @description Bar animation frame
  12050. * @type {Number}
  12051. * @default animationFrame = 50
  12052. */
  12053. animationFrame: 50
  12054. };
  12055. exports.barConfig = barConfig;
  12056. });
  12057. unwrapExports(bar);
  12058. var bar_1 = bar.barConfig;
  12059. var pie$1 = createCommonjsModule(function (module, exports) {
  12060. Object.defineProperty(exports, "__esModule", {
  12061. value: true
  12062. });
  12063. exports.pieConfig = void 0;
  12064. var pieConfig = {
  12065. /**
  12066. * @description Whether to display this pie chart
  12067. * @type {Boolean}
  12068. * @default show = true
  12069. */
  12070. show: true,
  12071. /**
  12072. * @description Legend name
  12073. * @type {String}
  12074. * @default name = ''
  12075. */
  12076. name: '',
  12077. /**
  12078. * @description Radius of pie
  12079. * @type {String|Number}
  12080. * @default radius = '50%'
  12081. * @example radius = '50%' | 100
  12082. */
  12083. radius: '50%',
  12084. /**
  12085. * @description Center point of pie
  12086. * @type {Array}
  12087. * @default center = ['50%','50%']
  12088. * @example center = ['50%','50%'] | [100, 100]
  12089. */
  12090. center: ['50%', '50%'],
  12091. /**
  12092. * @description Pie chart start angle
  12093. * @type {Number}
  12094. * @default startAngle = -Math.PI / 2
  12095. * @example startAngle = -Math.PI
  12096. */
  12097. startAngle: -Math.PI / 2,
  12098. /**
  12099. * @description Whether to enable rose type
  12100. * @type {Boolean}
  12101. * @default roseType = false
  12102. */
  12103. roseType: false,
  12104. /**
  12105. * @description Automatic sorting in rose type
  12106. * @type {Boolean}
  12107. * @default roseSort = true
  12108. */
  12109. roseSort: true,
  12110. /**
  12111. * @description Rose radius increasing
  12112. * @type {String|Number}
  12113. * @default roseIncrement = 'auto'
  12114. * @example roseIncrement = 'auto' | '10%' | 10
  12115. */
  12116. roseIncrement: 'auto',
  12117. /**
  12118. * @description Pie chart data
  12119. * @type {Array}
  12120. * @default data = []
  12121. */
  12122. data: [],
  12123. /**
  12124. * @description Pie inside label configuration
  12125. * @type {Object}
  12126. */
  12127. insideLabel: {
  12128. /**
  12129. * @description Whether to display inside label
  12130. * @type {Boolean}
  12131. * @default show = false
  12132. */
  12133. show: false,
  12134. /**
  12135. * @description Label formatter
  12136. * @type {String|Function}
  12137. * @default formatter = '{percent}%'
  12138. * @example formatter = '${name}-{value}-{percent}%'
  12139. * @example formatter = (dataItem) => (dataItem.name)
  12140. */
  12141. formatter: '{percent}%',
  12142. /**
  12143. * @description Label default style configuration
  12144. * @type {Object}
  12145. * @default style = {Configuration Of Class Style}
  12146. */
  12147. style: {
  12148. fontSize: 10,
  12149. fill: '#fff',
  12150. textAlign: 'center',
  12151. textBaseline: 'middle'
  12152. }
  12153. },
  12154. /**
  12155. * @description Pie Outside label configuration
  12156. * @type {Object}
  12157. */
  12158. outsideLabel: {
  12159. /**
  12160. * @description Whether to display outside label
  12161. * @type {Boolean}
  12162. * @default show = false
  12163. */
  12164. show: true,
  12165. /**
  12166. * @description Label formatter
  12167. * @type {String|Function}
  12168. * @default formatter = '{name}'
  12169. * @example formatter = '${name}-{value}-{percent}%'
  12170. * @example formatter = (dataItem) => (dataItem.name)
  12171. */
  12172. formatter: '{name}',
  12173. /**
  12174. * @description Label default style configuration
  12175. * @type {Object}
  12176. * @default style = {Configuration Of Class Style}
  12177. */
  12178. style: {
  12179. fontSize: 11
  12180. },
  12181. /**
  12182. * @description Gap beteen label line bended place and pie
  12183. * @type {String|Number}
  12184. * @default labelLineBendGap = '20%'
  12185. * @example labelLineBendGap = '20%' | 20
  12186. */
  12187. labelLineBendGap: '20%',
  12188. /**
  12189. * @description Label line end length
  12190. * @type {Number}
  12191. * @default labelLineEndLength = 50
  12192. */
  12193. labelLineEndLength: 50,
  12194. /**
  12195. * @description Label line default style configuration
  12196. * @type {Object}
  12197. * @default style = {Configuration Of Class Style}
  12198. */
  12199. labelLineStyle: {
  12200. lineWidth: 1
  12201. }
  12202. },
  12203. /**
  12204. * @description Pie default style configuration
  12205. * @type {Object}
  12206. * @default style = {Configuration Of Class Style}
  12207. */
  12208. pieStyle: {},
  12209. /**
  12210. * @description Percentage fractional precision
  12211. * @type {Number}
  12212. * @default percentToFixed = 0
  12213. */
  12214. percentToFixed: 0,
  12215. /**
  12216. * @description Pie chart render level
  12217. * Priority rendering high level
  12218. * @type {Number}
  12219. * @default rLevel = 10
  12220. */
  12221. rLevel: 10,
  12222. /**
  12223. * @description Animation delay gap
  12224. * @type {Number}
  12225. * @default animationDelayGap = 60
  12226. */
  12227. animationDelayGap: 60,
  12228. /**
  12229. * @description Pie animation curve
  12230. * @type {String}
  12231. * @default animationCurve = 'easeOutCubic'
  12232. */
  12233. animationCurve: 'easeOutCubic',
  12234. /**
  12235. * @description Pie start animation curve
  12236. * @type {String}
  12237. * @default startAnimationCurve = 'easeOutBack'
  12238. */
  12239. startAnimationCurve: 'easeOutBack',
  12240. /**
  12241. * @description Pie animation frame
  12242. * @type {Number}
  12243. * @default animationFrame = 50
  12244. */
  12245. animationFrame: 50
  12246. };
  12247. exports.pieConfig = pieConfig;
  12248. });
  12249. unwrapExports(pie$1);
  12250. var pie_1 = pie$1.pieConfig;
  12251. var radarAxis = createCommonjsModule(function (module, exports) {
  12252. Object.defineProperty(exports, "__esModule", {
  12253. value: true
  12254. });
  12255. exports.radarAxisConfig = void 0;
  12256. var radarAxisConfig = {
  12257. /**
  12258. * @description Whether to display this radar axis
  12259. * @type {Boolean}
  12260. * @default show = true
  12261. */
  12262. show: true,
  12263. /**
  12264. * @description Center point of radar axis
  12265. * @type {Array}
  12266. * @default center = ['50%','50%']
  12267. * @example center = ['50%','50%'] | [100, 100]
  12268. */
  12269. center: ['50%', '50%'],
  12270. /**
  12271. * @description Radius of radar axis
  12272. * @type {String|Number}
  12273. * @default radius = '65%'
  12274. * @example radius = '65%' | 100
  12275. */
  12276. radius: '65%',
  12277. /**
  12278. * @description Radar axis start angle
  12279. * @type {Number}
  12280. * @default startAngle = -Math.PI / 2
  12281. * @example startAngle = -Math.PI
  12282. */
  12283. startAngle: -Math.PI / 2,
  12284. /**
  12285. * @description Radar axis split number
  12286. * @type {Number}
  12287. * @default splitNum = 5
  12288. */
  12289. splitNum: 5,
  12290. /**
  12291. * @description Whether to enable polygon radar axis
  12292. * @type {Boolean}
  12293. * @default polygon = false
  12294. */
  12295. polygon: false,
  12296. /**
  12297. * @description Axis label configuration
  12298. * @type {Object}
  12299. */
  12300. axisLabel: {
  12301. /**
  12302. * @description Whether to display axis label
  12303. * @type {Boolean}
  12304. * @default show = true
  12305. */
  12306. show: true,
  12307. /**
  12308. * @description Label gap between label and radar axis
  12309. * @type {Number}
  12310. * @default labelGap = 15
  12311. */
  12312. labelGap: 15,
  12313. /**
  12314. * @description Label color (Hex|rgb|rgba), will cover style.fill
  12315. * @type {Array}
  12316. * @default color = []
  12317. */
  12318. color: [],
  12319. /**
  12320. * @description Axis label default style configuration
  12321. * @type {Object}
  12322. * @default style = {Configuration Of Class Style}
  12323. */
  12324. style: {
  12325. fill: '#333'
  12326. }
  12327. },
  12328. /**
  12329. * @description Axis line configuration
  12330. * @type {Object}
  12331. */
  12332. axisLine: {
  12333. /**
  12334. * @description Whether to display axis line
  12335. * @type {Boolean}
  12336. * @default show = true
  12337. */
  12338. show: true,
  12339. /**
  12340. * @description Line color (Hex|rgb|rgba), will cover style.stroke
  12341. * @type {Array}
  12342. * @default color = []
  12343. */
  12344. color: [],
  12345. /**
  12346. * @description Axis label default style configuration
  12347. * @type {Object}
  12348. * @default style = {Configuration Of Class Style}
  12349. */
  12350. style: {
  12351. stroke: '#999',
  12352. lineWidth: 1
  12353. }
  12354. },
  12355. /**
  12356. * @description Split line configuration
  12357. * @type {Object}
  12358. */
  12359. splitLine: {
  12360. /**
  12361. * @description Whether to display split line
  12362. * @type {Boolean}
  12363. * @default show = true
  12364. */
  12365. show: true,
  12366. /**
  12367. * @description Line color (Hex|rgb|rgba), will cover style.stroke
  12368. * @type {Array}
  12369. * @default color = []
  12370. */
  12371. color: [],
  12372. /**
  12373. * @description Split line default style configuration
  12374. * @type {Object}
  12375. * @default style = {Configuration Of Class Style}
  12376. */
  12377. style: {
  12378. stroke: '#d4d4d4',
  12379. lineWidth: 1
  12380. }
  12381. },
  12382. /**
  12383. * @description Split area configuration
  12384. * @type {Object}
  12385. */
  12386. splitArea: {
  12387. /**
  12388. * @description Whether to display split area
  12389. * @type {Boolean}
  12390. * @default show = false
  12391. */
  12392. show: false,
  12393. /**
  12394. * @description Area color (Hex|rgb|rgba), will cover style.stroke
  12395. * @type {Array}
  12396. * @default color = []
  12397. */
  12398. color: ['#f5f5f5', '#e6e6e6'],
  12399. /**
  12400. * @description Split area default style configuration
  12401. * @type {Object}
  12402. * @default style = {Configuration Of Class Style}
  12403. */
  12404. style: {}
  12405. },
  12406. /**
  12407. * @description Bar chart render level
  12408. * Priority rendering high level
  12409. * @type {Number}
  12410. * @default rLevel = -10
  12411. */
  12412. rLevel: -10,
  12413. /**
  12414. * @description Radar axis animation curve
  12415. * @type {String}
  12416. * @default animationCurve = 'easeOutCubic'
  12417. */
  12418. animationCurve: 'easeOutCubic',
  12419. /**
  12420. * @description Radar axis animation frame
  12421. * @type {Number}
  12422. * @default animationFrame = 50
  12423. */
  12424. animationFrane: 50
  12425. };
  12426. exports.radarAxisConfig = radarAxisConfig;
  12427. });
  12428. unwrapExports(radarAxis);
  12429. var radarAxis_1 = radarAxis.radarAxisConfig;
  12430. var radar = createCommonjsModule(function (module, exports) {
  12431. Object.defineProperty(exports, "__esModule", {
  12432. value: true
  12433. });
  12434. exports.radarConfig = void 0;
  12435. var radarConfig = {
  12436. /**
  12437. * @description Whether to display this radar
  12438. * @type {Boolean}
  12439. * @default show = true
  12440. */
  12441. show: true,
  12442. /**
  12443. * @description Legend name
  12444. * @type {String}
  12445. * @default name = ''
  12446. */
  12447. name: '',
  12448. /**
  12449. * @description Radar chart data
  12450. * @type {Array}
  12451. * @default data = []
  12452. * @example data = [100, 200, 300]
  12453. */
  12454. data: [],
  12455. /**
  12456. * @description Radar default style configuration
  12457. * @type {Object}
  12458. * @default style = {Configuration Of Class Style}
  12459. */
  12460. radarStyle: {
  12461. lineWidth: 1
  12462. },
  12463. /**
  12464. * @description Radar point configuration
  12465. * @type {Object}
  12466. */
  12467. point: {
  12468. /**
  12469. * @description Whether to display radar point
  12470. * @type {Boolean}
  12471. * @default show = true
  12472. */
  12473. show: true,
  12474. /**
  12475. * @description Point radius
  12476. * @type {Number}
  12477. * @default radius = 2
  12478. */
  12479. radius: 2,
  12480. /**
  12481. * @description Radar point default style configuration
  12482. * @type {Object}
  12483. * @default style = {Configuration Of Class Style}
  12484. */
  12485. style: {
  12486. fill: '#fff'
  12487. }
  12488. },
  12489. /**
  12490. * @description Radar label configuration
  12491. * @type {Object}
  12492. */
  12493. label: {
  12494. /**
  12495. * @description Whether to display radar label
  12496. * @type {Boolean}
  12497. * @default show = true
  12498. */
  12499. show: true,
  12500. /**
  12501. * @description Label position offset
  12502. * @type {Array}
  12503. * @default offset = [0, 0]
  12504. */
  12505. offset: [0, 0],
  12506. /**
  12507. * @description Label gap between label and radar
  12508. * @type {Number}
  12509. * @default labelGap = 5
  12510. */
  12511. labelGap: 5,
  12512. /**
  12513. * @description Label formatter
  12514. * @type {String|Function}
  12515. * @default formatter = null
  12516. * @example formatter = 'Score-{value}'
  12517. * @example formatter = (label) => (label)
  12518. */
  12519. formatter: null,
  12520. /**
  12521. * @description Radar label default style configuration
  12522. * @type {Object}
  12523. * @default style = {Configuration Of Class Style}
  12524. */
  12525. style: {
  12526. fontSize: 10
  12527. }
  12528. },
  12529. /**
  12530. * @description Radar chart render level
  12531. * Priority rendering high level
  12532. * @type {Number}
  12533. * @default rLevel = 10
  12534. */
  12535. rLevel: 10,
  12536. /**
  12537. * @description Radar animation curve
  12538. * @type {String}
  12539. * @default animationCurve = 'easeOutCubic'
  12540. */
  12541. animationCurve: 'easeOutCubic',
  12542. /**
  12543. * @description Radar animation frame
  12544. * @type {Number}
  12545. * @default animationFrame = 50
  12546. */
  12547. animationFrane: 50
  12548. };
  12549. exports.radarConfig = radarConfig;
  12550. });
  12551. unwrapExports(radar);
  12552. var radar_1 = radar.radarConfig;
  12553. var gauge = createCommonjsModule(function (module, exports) {
  12554. Object.defineProperty(exports, "__esModule", {
  12555. value: true
  12556. });
  12557. exports.gaugeConfig = void 0;
  12558. var gaugeConfig = {
  12559. /**
  12560. * @description Whether to display this gauge
  12561. * @type {Boolean}
  12562. * @default show = true
  12563. */
  12564. show: true,
  12565. /**
  12566. * @description Legend name
  12567. * @type {String}
  12568. * @default name = ''
  12569. */
  12570. name: '',
  12571. /**
  12572. * @description Radius of gauge
  12573. * @type {String|Number}
  12574. * @default radius = '60%'
  12575. * @example radius = '60%' | 100
  12576. */
  12577. radius: '60%',
  12578. /**
  12579. * @description Center point of gauge
  12580. * @type {Array}
  12581. * @default center = ['50%','50%']
  12582. * @example center = ['50%','50%'] | [100, 100]
  12583. */
  12584. center: ['50%', '50%'],
  12585. /**
  12586. * @description Gauge start angle
  12587. * @type {Number}
  12588. * @default startAngle = -(Math.PI / 4) * 5
  12589. * @example startAngle = -Math.PI
  12590. */
  12591. startAngle: -(Math.PI / 4) * 5,
  12592. /**
  12593. * @description Gauge end angle
  12594. * @type {Number}
  12595. * @default endAngle = Math.PI / 4
  12596. * @example endAngle = 0
  12597. */
  12598. endAngle: Math.PI / 4,
  12599. /**
  12600. * @description Gauge min value
  12601. * @type {Number}
  12602. * @default min = 0
  12603. */
  12604. min: 0,
  12605. /**
  12606. * @description Gauge max value
  12607. * @type {Number}
  12608. * @default max = 100
  12609. */
  12610. max: 100,
  12611. /**
  12612. * @description Gauge split number
  12613. * @type {Number}
  12614. * @default splitNum = 5
  12615. */
  12616. splitNum: 5,
  12617. /**
  12618. * @description Gauge arc line width
  12619. * @type {Number}
  12620. * @default arcLineWidth = 15
  12621. */
  12622. arcLineWidth: 15,
  12623. /**
  12624. * @description Gauge chart data
  12625. * @type {Array}
  12626. * @default data = []
  12627. */
  12628. data: [],
  12629. /**
  12630. * @description Data item arc default style configuration
  12631. * @type {Object}
  12632. * @default dataItemStyle = {Configuration Of Class Style}
  12633. */
  12634. dataItemStyle: {},
  12635. /**
  12636. * @description Axis tick configuration
  12637. * @type {Object}
  12638. */
  12639. axisTick: {
  12640. /**
  12641. * @description Whether to display axis tick
  12642. * @type {Boolean}
  12643. * @default show = true
  12644. */
  12645. show: true,
  12646. /**
  12647. * @description Axis tick length
  12648. * @type {Number}
  12649. * @default tickLength = 6
  12650. */
  12651. tickLength: 6,
  12652. /**
  12653. * @description Axis tick default style configuration
  12654. * @type {Object}
  12655. * @default style = {Configuration Of Class Style}
  12656. */
  12657. style: {
  12658. stroke: '#999',
  12659. lineWidth: 1
  12660. }
  12661. },
  12662. /**
  12663. * @description Axis label configuration
  12664. * @type {Object}
  12665. */
  12666. axisLabel: {
  12667. /**
  12668. * @description Whether to display axis label
  12669. * @type {Boolean}
  12670. * @default show = true
  12671. */
  12672. show: true,
  12673. /**
  12674. * @description Axis label data (Can be calculated automatically)
  12675. * @type {Array}
  12676. * @default data = [Number...]
  12677. */
  12678. data: [],
  12679. /**
  12680. * @description Axis label formatter
  12681. * @type {String|Function}
  12682. * @default formatter = null
  12683. * @example formatter = '{value}%'
  12684. * @example formatter = (labelItem) => (labelItem.value)
  12685. */
  12686. formatter: null,
  12687. /**
  12688. * @description Axis label gap between label and axis tick
  12689. * @type {String|Function}
  12690. * @default labelGap = 5
  12691. */
  12692. labelGap: 5,
  12693. /**
  12694. * @description Axis label default style configuration
  12695. * @type {Object}
  12696. * @default style = {Configuration Of Class Style}
  12697. */
  12698. style: {}
  12699. },
  12700. /**
  12701. * @description Gauge pointer configuration
  12702. * @type {Object}
  12703. */
  12704. pointer: {
  12705. /**
  12706. * @description Whether to display pointer
  12707. * @type {Boolean}
  12708. * @default show = true
  12709. */
  12710. show: true,
  12711. /**
  12712. * @description Pointer value index of data
  12713. * @type {Number}
  12714. * @default valueIndex = 0 (pointer.value = data[0].value)
  12715. */
  12716. valueIndex: 0,
  12717. /**
  12718. * @description Pointer default style configuration
  12719. * @type {Object}
  12720. * @default style = {Configuration Of Class Style}
  12721. */
  12722. style: {
  12723. scale: [1, 1],
  12724. fill: '#fb7293'
  12725. }
  12726. },
  12727. /**
  12728. * @description Data item arc detail configuration
  12729. * @type {Object}
  12730. */
  12731. details: {
  12732. /**
  12733. * @description Whether to display details
  12734. * @type {Boolean}
  12735. * @default show = false
  12736. */
  12737. show: false,
  12738. /**
  12739. * @description Details formatter
  12740. * @type {String|Function}
  12741. * @default formatter = null
  12742. * @example formatter = '{value}%'
  12743. * @example formatter = '{name}%'
  12744. * @example formatter = (dataItem) => (dataItem.value)
  12745. */
  12746. formatter: null,
  12747. /**
  12748. * @description Details position offset
  12749. * @type {Array}
  12750. * @default offset = [0, 0]
  12751. * @example offset = [10, 10]
  12752. */
  12753. offset: [0, 0],
  12754. /**
  12755. * @description Value fractional precision
  12756. * @type {Number}
  12757. * @default valueToFixed = 0
  12758. */
  12759. valueToFixed: 0,
  12760. /**
  12761. * @description Details position
  12762. * @type {String}
  12763. * @default position = 'center'
  12764. * @example position = 'start' | 'center' | 'end'
  12765. */
  12766. position: 'center',
  12767. /**
  12768. * @description Details default style configuration
  12769. * @type {Object}
  12770. * @default style = {Configuration Of Class Style}
  12771. */
  12772. style: {
  12773. fontSize: 20,
  12774. fontWeight: 'bold',
  12775. textAlign: 'center',
  12776. textBaseline: 'middle'
  12777. }
  12778. },
  12779. /**
  12780. * @description Gauge background arc configuration
  12781. * @type {Object}
  12782. */
  12783. backgroundArc: {
  12784. /**
  12785. * @description Whether to display background arc
  12786. * @type {Boolean}
  12787. * @default show = true
  12788. */
  12789. show: true,
  12790. /**
  12791. * @description Background arc default style configuration
  12792. * @type {Object}
  12793. * @default style = {Configuration Of Class Style}
  12794. */
  12795. style: {
  12796. stroke: '#e0e0e0'
  12797. }
  12798. },
  12799. /**
  12800. * @description Gauge chart render level
  12801. * Priority rendering high level
  12802. * @type {Number}
  12803. * @default rLevel = 10
  12804. */
  12805. rLevel: 10,
  12806. /**
  12807. * @description Gauge animation curve
  12808. * @type {String}
  12809. * @default animationCurve = 'easeOutCubic'
  12810. */
  12811. animationCurve: 'easeOutCubic',
  12812. /**
  12813. * @description Gauge animation frame
  12814. * @type {Number}
  12815. * @default animationFrame = 50
  12816. */
  12817. animationFrame: 50
  12818. };
  12819. exports.gaugeConfig = gaugeConfig;
  12820. });
  12821. unwrapExports(gauge);
  12822. var gauge_1 = gauge.gaugeConfig;
  12823. var legend = createCommonjsModule(function (module, exports) {
  12824. Object.defineProperty(exports, "__esModule", {
  12825. value: true
  12826. });
  12827. exports.legendConfig = void 0;
  12828. var legendConfig = {
  12829. /**
  12830. * @description Whether to display legend
  12831. * @type {Boolean}
  12832. * @default show = true
  12833. */
  12834. show: true,
  12835. /**
  12836. * @description Legend orient
  12837. * @type {String}
  12838. * @default orient = 'horizontal'
  12839. * @example orient = 'horizontal' | 'vertical'
  12840. */
  12841. orient: 'horizontal',
  12842. /**
  12843. * @description Legend left
  12844. * @type {String|Number}
  12845. * @default left = 'auto'
  12846. * @example left = 'auto' | '10%' | 10
  12847. */
  12848. left: 'auto',
  12849. /**
  12850. * @description Legend right
  12851. * @type {String|Number}
  12852. * @default right = 'auto'
  12853. * @example right = 'auto' | '10%' | 10
  12854. */
  12855. right: 'auto',
  12856. /**
  12857. * @description Legend top
  12858. * @type {String|Number}
  12859. * @default top = 'auto'
  12860. * @example top = 'auto' | '10%' | 10
  12861. */
  12862. top: 'auto',
  12863. /**
  12864. * @description Legend bottom
  12865. * @type {String|Number}
  12866. * @default bottom = 'auto'
  12867. * @example bottom = 'auto' | '10%' | 10
  12868. */
  12869. bottom: 'auto',
  12870. /**
  12871. * @description Legend item gap
  12872. * @type {Number}
  12873. * @default itemGap = 10
  12874. */
  12875. itemGap: 10,
  12876. /**
  12877. * @description Icon width
  12878. * @type {Number}
  12879. * @default iconWidth = 25
  12880. */
  12881. iconWidth: 25,
  12882. /**
  12883. * @description Icon height
  12884. * @type {Number}
  12885. * @default iconHeight = 10
  12886. */
  12887. iconHeight: 10,
  12888. /**
  12889. * @description Whether legend is optional
  12890. * @type {Boolean}
  12891. * @default selectAble = true
  12892. */
  12893. selectAble: true,
  12894. /**
  12895. * @description Legend data
  12896. * @type {Array}
  12897. * @default data = []
  12898. */
  12899. data: [],
  12900. /**
  12901. * @description Legend text default style configuration
  12902. * @type {Object}
  12903. * @default style = {Configuration Of Class Style}
  12904. */
  12905. textStyle: {
  12906. fontFamily: 'Arial',
  12907. fontSize: 13,
  12908. fill: '#000'
  12909. },
  12910. /**
  12911. * @description Legend icon default style configuration
  12912. * @type {Object}
  12913. * @default style = {Configuration Of Class Style}
  12914. */
  12915. iconStyle: {},
  12916. /**
  12917. * @description Legend text unselected default style configuration
  12918. * @type {Object}
  12919. * @default style = {Configuration Of Class Style}
  12920. */
  12921. textUnselectedStyle: {
  12922. fontFamily: 'Arial',
  12923. fontSize: 13,
  12924. fill: '#999'
  12925. },
  12926. /**
  12927. * @description Legend icon unselected default style configuration
  12928. * @type {Object}
  12929. * @default style = {Configuration Of Class Style}
  12930. */
  12931. iconUnselectedStyle: {
  12932. fill: '#999'
  12933. },
  12934. /**
  12935. * @description Legend render level
  12936. * Priority rendering high level
  12937. * @type {Number}
  12938. * @default rLevel = 20
  12939. */
  12940. rLevel: 20,
  12941. /**
  12942. * @description Legend animation curve
  12943. * @type {String}
  12944. * @default animationCurve = 'easeOutCubic'
  12945. */
  12946. animationCurve: 'easeOutCubic',
  12947. /**
  12948. * @description Legend animation frame
  12949. * @type {Number}
  12950. * @default animationFrame = 50
  12951. */
  12952. animationFrame: 50
  12953. };
  12954. exports.legendConfig = legendConfig;
  12955. });
  12956. unwrapExports(legend);
  12957. var legend_1 = legend.legendConfig;
  12958. var config = createCommonjsModule(function (module, exports) {
  12959. Object.defineProperty(exports, "__esModule", {
  12960. value: true
  12961. });
  12962. exports.changeDefaultConfig = changeDefaultConfig;
  12963. Object.defineProperty(exports, "colorConfig", {
  12964. enumerable: true,
  12965. get: function get() {
  12966. return color.colorConfig;
  12967. }
  12968. });
  12969. Object.defineProperty(exports, "gridConfig", {
  12970. enumerable: true,
  12971. get: function get() {
  12972. return grid.gridConfig;
  12973. }
  12974. });
  12975. Object.defineProperty(exports, "xAxisConfig", {
  12976. enumerable: true,
  12977. get: function get() {
  12978. return axis.xAxisConfig;
  12979. }
  12980. });
  12981. Object.defineProperty(exports, "yAxisConfig", {
  12982. enumerable: true,
  12983. get: function get() {
  12984. return axis.yAxisConfig;
  12985. }
  12986. });
  12987. Object.defineProperty(exports, "titleConfig", {
  12988. enumerable: true,
  12989. get: function get() {
  12990. return title.titleConfig;
  12991. }
  12992. });
  12993. Object.defineProperty(exports, "lineConfig", {
  12994. enumerable: true,
  12995. get: function get() {
  12996. return line.lineConfig;
  12997. }
  12998. });
  12999. Object.defineProperty(exports, "barConfig", {
  13000. enumerable: true,
  13001. get: function get() {
  13002. return bar.barConfig;
  13003. }
  13004. });
  13005. Object.defineProperty(exports, "pieConfig", {
  13006. enumerable: true,
  13007. get: function get() {
  13008. return pie$1.pieConfig;
  13009. }
  13010. });
  13011. Object.defineProperty(exports, "radarAxisConfig", {
  13012. enumerable: true,
  13013. get: function get() {
  13014. return radarAxis.radarAxisConfig;
  13015. }
  13016. });
  13017. Object.defineProperty(exports, "radarConfig", {
  13018. enumerable: true,
  13019. get: function get() {
  13020. return radar.radarConfig;
  13021. }
  13022. });
  13023. Object.defineProperty(exports, "gaugeConfig", {
  13024. enumerable: true,
  13025. get: function get() {
  13026. return gauge.gaugeConfig;
  13027. }
  13028. });
  13029. Object.defineProperty(exports, "legendConfig", {
  13030. enumerable: true,
  13031. get: function get() {
  13032. return legend.legendConfig;
  13033. }
  13034. });
  13035. exports.keys = void 0;
  13036. var allConfig = {
  13037. colorConfig: color.colorConfig,
  13038. gridConfig: grid.gridConfig,
  13039. xAxisConfig: axis.xAxisConfig,
  13040. yAxisConfig: axis.yAxisConfig,
  13041. titleConfig: title.titleConfig,
  13042. lineConfig: line.lineConfig,
  13043. barConfig: bar.barConfig,
  13044. pieConfig: pie$1.pieConfig,
  13045. radarAxisConfig: radarAxis.radarAxisConfig,
  13046. radarConfig: radar.radarConfig,
  13047. gaugeConfig: gauge.gaugeConfig,
  13048. legendConfig: legend.legendConfig
  13049. /**
  13050. * @description Change default configuration
  13051. * @param {String} key Configuration key
  13052. * @param {Object|Array} config Your config
  13053. * @return {Undefined} No return
  13054. */
  13055. };
  13056. function changeDefaultConfig(key, config) {
  13057. if (!allConfig["".concat(key, "Config")]) {
  13058. console.warn('Change default config Error - Invalid key!');
  13059. return;
  13060. }
  13061. (0, util$1.deepMerge)(allConfig["".concat(key, "Config")], config);
  13062. }
  13063. var keys = ['color', 'title', 'legend', 'xAxis', 'yAxis', 'grid', 'radarAxis', 'line', 'bar', 'pie', 'radar', 'gauge'];
  13064. exports.keys = keys;
  13065. });
  13066. unwrapExports(config);
  13067. var config_1 = config.changeDefaultConfig;
  13068. var config_2 = config.keys;
  13069. var mergeColor_1 = createCommonjsModule(function (module, exports) {
  13070. Object.defineProperty(exports, "__esModule", {
  13071. value: true
  13072. });
  13073. exports.mergeColor = mergeColor;
  13074. function mergeColor(chart) {
  13075. var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13076. var defaultColor = (0, util.deepClone)(config.colorConfig, true);
  13077. var color = option.color,
  13078. series = option.series;
  13079. if (!series) series = [];
  13080. if (!color) color = [];
  13081. option.color = color = (0, util$1.deepMerge)(defaultColor, color);
  13082. if (!series.length) return;
  13083. var colorNum = color.length;
  13084. series.forEach(function (item, i) {
  13085. if (item.color) return;
  13086. item.color = color[i % colorNum];
  13087. });
  13088. var pies = series.filter(function (_ref) {
  13089. var type = _ref.type;
  13090. return type === 'pie';
  13091. });
  13092. pies.forEach(function (pie) {
  13093. return pie.data.forEach(function (di, i) {
  13094. return di.color = color[i % colorNum];
  13095. });
  13096. });
  13097. var gauges = series.filter(function (_ref2) {
  13098. var type = _ref2.type;
  13099. return type === 'gauge';
  13100. });
  13101. gauges.forEach(function (gauge) {
  13102. return gauge.data.forEach(function (di, i) {
  13103. return di.color = color[i % colorNum];
  13104. });
  13105. });
  13106. var barWithIndependentColor = series.filter(function (_ref3) {
  13107. var type = _ref3.type,
  13108. independentColor = _ref3.independentColor;
  13109. return type === 'bar' && independentColor;
  13110. });
  13111. barWithIndependentColor.forEach(function (bar) {
  13112. if (bar.independentColors) return;
  13113. bar.independentColors = color;
  13114. });
  13115. }
  13116. });
  13117. unwrapExports(mergeColor_1);
  13118. var mergeColor_2 = mergeColor_1.mergeColor;
  13119. var updater_class = createCommonjsModule(function (module, exports) {
  13120. Object.defineProperty(exports, "__esModule", {
  13121. value: true
  13122. });
  13123. exports.doUpdate = doUpdate;
  13124. exports.Updater = void 0;
  13125. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  13126. var _typeof2 = interopRequireDefault(_typeof_1);
  13127. var _classCallCheck2 = interopRequireDefault(classCallCheck);
  13128. var Updater = function Updater(config, series) {
  13129. (0, _classCallCheck2["default"])(this, Updater);
  13130. var chart = config.chart,
  13131. key = config.key,
  13132. getGraphConfig = config.getGraphConfig;
  13133. if (typeof getGraphConfig !== 'function') {
  13134. console.warn('Updater need function getGraphConfig!');
  13135. return;
  13136. }
  13137. if (!chart[key]) this.graphs = chart[key] = [];
  13138. Object.assign(this, config);
  13139. this.update(series);
  13140. };
  13141. exports.Updater = Updater;
  13142. Updater.prototype.update = function (series) {
  13143. var _this = this;
  13144. var graphs = this.graphs,
  13145. beforeUpdate = this.beforeUpdate;
  13146. delRedundanceGraph(this, series);
  13147. if (!series.length) return;
  13148. var beforeUpdateType = (0, _typeof2["default"])(beforeUpdate);
  13149. series.forEach(function (seriesItem, i) {
  13150. if (beforeUpdateType === 'function') beforeUpdate(graphs, seriesItem, i, _this);
  13151. var cache = graphs[i];
  13152. if (cache) {
  13153. changeGraphs(cache, seriesItem, i, _this);
  13154. } else {
  13155. addGraphs(graphs, seriesItem, i, _this);
  13156. }
  13157. });
  13158. };
  13159. function delRedundanceGraph(updater, series) {
  13160. var graphs = updater.graphs,
  13161. render = updater.chart.render;
  13162. var cacheGraphNum = graphs.length;
  13163. var needGraphNum = series.length;
  13164. if (cacheGraphNum > needGraphNum) {
  13165. var needDelGraphs = graphs.splice(needGraphNum);
  13166. needDelGraphs.forEach(function (item) {
  13167. return item.forEach(function (g) {
  13168. return render.delGraph(g);
  13169. });
  13170. });
  13171. }
  13172. }
  13173. function changeGraphs(cache, seriesItem, i, updater) {
  13174. var getGraphConfig = updater.getGraphConfig,
  13175. render = updater.chart.render,
  13176. beforeChange = updater.beforeChange;
  13177. var configs = getGraphConfig(seriesItem, updater);
  13178. balanceGraphsNum(cache, configs, render);
  13179. cache.forEach(function (graph, j) {
  13180. var config = configs[j];
  13181. if (typeof beforeChange === 'function') beforeChange(graph, config);
  13182. updateGraphConfigByKey(graph, config);
  13183. });
  13184. }
  13185. function balanceGraphsNum(graphs, graphConfig, render) {
  13186. var cacheGraphNum = graphs.length;
  13187. var needGraphNum = graphConfig.length;
  13188. if (needGraphNum > cacheGraphNum) {
  13189. var lastCacheGraph = graphs.slice(-1)[0];
  13190. var needAddGraphNum = needGraphNum - cacheGraphNum;
  13191. var needAddGraphs = new Array(needAddGraphNum).fill(0).map(function (foo) {
  13192. return render.clone(lastCacheGraph);
  13193. });
  13194. graphs.push.apply(graphs, (0, _toConsumableArray2["default"])(needAddGraphs));
  13195. } else if (needGraphNum < cacheGraphNum) {
  13196. var needDelCache = graphs.splice(needGraphNum);
  13197. needDelCache.forEach(function (g) {
  13198. return render.delGraph(g);
  13199. });
  13200. }
  13201. }
  13202. function addGraphs(graphs, seriesItem, i, updater) {
  13203. var getGraphConfig = updater.getGraphConfig,
  13204. getStartGraphConfig = updater.getStartGraphConfig,
  13205. chart = updater.chart;
  13206. var render = chart.render;
  13207. var startConfigs = null;
  13208. if (typeof getStartGraphConfig === 'function') startConfigs = getStartGraphConfig(seriesItem, updater);
  13209. var configs = getGraphConfig(seriesItem, updater);
  13210. if (!configs.length) return;
  13211. if (startConfigs) {
  13212. graphs[i] = startConfigs.map(function (config) {
  13213. return render.add(config);
  13214. });
  13215. graphs[i].forEach(function (graph, i) {
  13216. var config = configs[i];
  13217. updateGraphConfigByKey(graph, config);
  13218. });
  13219. } else {
  13220. graphs[i] = configs.map(function (config) {
  13221. return render.add(config);
  13222. });
  13223. }
  13224. var afterAddGraph = updater.afterAddGraph;
  13225. if (typeof afterAddGraph === 'function') afterAddGraph(graphs[i]);
  13226. }
  13227. function updateGraphConfigByKey(graph, config) {
  13228. var keys = Object.keys(config);
  13229. keys.forEach(function (key) {
  13230. if (key === 'shape' || key === 'style') {
  13231. graph.animation(key, config[key], true);
  13232. } else {
  13233. graph[key] = config[key];
  13234. }
  13235. });
  13236. }
  13237. function doUpdate() {
  13238. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13239. chart = _ref.chart,
  13240. series = _ref.series,
  13241. key = _ref.key,
  13242. getGraphConfig = _ref.getGraphConfig,
  13243. getStartGraphConfig = _ref.getStartGraphConfig,
  13244. beforeChange = _ref.beforeChange,
  13245. beforeUpdate = _ref.beforeUpdate,
  13246. afterAddGraph = _ref.afterAddGraph;
  13247. if (chart[key]) {
  13248. chart[key].update(series);
  13249. } else {
  13250. chart[key] = new Updater({
  13251. chart: chart,
  13252. key: key,
  13253. getGraphConfig: getGraphConfig,
  13254. getStartGraphConfig: getStartGraphConfig,
  13255. beforeChange: beforeChange,
  13256. beforeUpdate: beforeUpdate,
  13257. afterAddGraph: afterAddGraph
  13258. }, series);
  13259. }
  13260. }
  13261. });
  13262. unwrapExports(updater_class);
  13263. var updater_class_1 = updater_class.doUpdate;
  13264. var updater_class_2 = updater_class.Updater;
  13265. var title_1$1 = createCommonjsModule(function (module, exports) {
  13266. Object.defineProperty(exports, "__esModule", {
  13267. value: true
  13268. });
  13269. exports.title = title;
  13270. var _slicedToArray2 = interopRequireDefault(slicedToArray);
  13271. function title(chart) {
  13272. var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13273. var title = [];
  13274. if (option.title) {
  13275. title[0] = (0, util$1.deepMerge)((0, util.deepClone)(config.titleConfig, true), option.title);
  13276. }
  13277. (0, updater_class.doUpdate)({
  13278. chart: chart,
  13279. series: title,
  13280. key: 'title',
  13281. getGraphConfig: getTitleConfig
  13282. });
  13283. }
  13284. function getTitleConfig(titleItem, updater) {
  13285. var animationCurve = config.titleConfig.animationCurve,
  13286. animationFrame = config.titleConfig.animationFrame,
  13287. rLevel = config.titleConfig.rLevel;
  13288. var shape = getTitleShape(titleItem, updater);
  13289. var style = getTitleStyle(titleItem);
  13290. return [{
  13291. name: 'text',
  13292. index: rLevel,
  13293. visible: titleItem.show,
  13294. animationCurve: animationCurve,
  13295. animationFrame: animationFrame,
  13296. shape: shape,
  13297. style: style
  13298. }];
  13299. }
  13300. function getTitleShape(titleItem, updater) {
  13301. var offset = titleItem.offset,
  13302. text = titleItem.text;
  13303. var _updater$chart$gridAr = updater.chart.gridArea,
  13304. x = _updater$chart$gridAr.x,
  13305. y = _updater$chart$gridAr.y,
  13306. w = _updater$chart$gridAr.w;
  13307. var _offset = (0, _slicedToArray2["default"])(offset, 2),
  13308. ox = _offset[0],
  13309. oy = _offset[1];
  13310. return {
  13311. content: text,
  13312. position: [x + w / 2 + ox, y + oy]
  13313. };
  13314. }
  13315. function getTitleStyle(titleItem) {
  13316. var style = titleItem.style;
  13317. return style;
  13318. }
  13319. });
  13320. unwrapExports(title_1$1);
  13321. var title_2 = title_1$1.title;
  13322. var grid_1$1 = createCommonjsModule(function (module, exports) {
  13323. Object.defineProperty(exports, "__esModule", {
  13324. value: true
  13325. });
  13326. exports.grid = grid;
  13327. var _slicedToArray2 = interopRequireDefault(slicedToArray);
  13328. var _defineProperty2 = interopRequireDefault(defineProperty);
  13329. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  13330. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  13331. function grid(chart) {
  13332. var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13333. var grid = option.grid;
  13334. grid = (0, util$1.deepMerge)((0, util.deepClone)(config.gridConfig, true), grid || {});
  13335. (0, updater_class.doUpdate)({
  13336. chart: chart,
  13337. series: [grid],
  13338. key: 'grid',
  13339. getGraphConfig: getGridConfig
  13340. });
  13341. }
  13342. function getGridConfig(gridItem, updater) {
  13343. var animationCurve = gridItem.animationCurve,
  13344. animationFrame = gridItem.animationFrame,
  13345. rLevel = gridItem.rLevel;
  13346. var shape = getGridShape(gridItem, updater);
  13347. var style = getGridStyle(gridItem);
  13348. updater.chart.gridArea = _objectSpread({}, shape);
  13349. return [{
  13350. name: 'rect',
  13351. index: rLevel,
  13352. animationCurve: animationCurve,
  13353. animationFrame: animationFrame,
  13354. shape: shape,
  13355. style: style
  13356. }];
  13357. }
  13358. function getGridShape(gridItem, updater) {
  13359. var _updater$chart$render = (0, _slicedToArray2["default"])(updater.chart.render.area, 2),
  13360. w = _updater$chart$render[0],
  13361. h = _updater$chart$render[1];
  13362. var left = getNumberValue(gridItem.left, w);
  13363. var right = getNumberValue(gridItem.right, w);
  13364. var top = getNumberValue(gridItem.top, h);
  13365. var bottom = getNumberValue(gridItem.bottom, h);
  13366. var width = w - left - right;
  13367. var height = h - top - bottom;
  13368. return {
  13369. x: left,
  13370. y: top,
  13371. w: width,
  13372. h: height
  13373. };
  13374. }
  13375. function getNumberValue(val, all) {
  13376. if (typeof val === 'number') return val;
  13377. if (typeof val !== 'string') return 0;
  13378. return all * parseInt(val) / 100;
  13379. }
  13380. function getGridStyle(gridItem) {
  13381. var style = gridItem.style;
  13382. return style;
  13383. }
  13384. });
  13385. unwrapExports(grid_1$1);
  13386. var grid_2 = grid_1$1.grid;
  13387. var axis_1$1 = createCommonjsModule(function (module, exports) {
  13388. Object.defineProperty(exports, "__esModule", {
  13389. value: true
  13390. });
  13391. exports.axis = axis;
  13392. var _typeof2 = interopRequireDefault(_typeof_1);
  13393. var _slicedToArray2 = interopRequireDefault(slicedToArray);
  13394. var _defineProperty2 = interopRequireDefault(defineProperty);
  13395. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  13396. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  13397. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  13398. var axisConfig = {
  13399. xAxisConfig: config.xAxisConfig,
  13400. yAxisConfig: config.yAxisConfig
  13401. };
  13402. var abs = Math.abs,
  13403. pow = Math.pow;
  13404. function axis(chart) {
  13405. var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13406. var xAxis = option.xAxis,
  13407. yAxis = option.yAxis,
  13408. series = option.series;
  13409. var allAxis = [];
  13410. if (xAxis && yAxis && series) {
  13411. allAxis = getAllAxis(xAxis, yAxis);
  13412. allAxis = mergeDefaultAxisConfig(allAxis);
  13413. allAxis = allAxis.filter(function (_ref) {
  13414. var show = _ref.show;
  13415. return show;
  13416. });
  13417. allAxis = mergeDefaultBoundaryGap(allAxis);
  13418. allAxis = calcAxisLabelData(allAxis, series);
  13419. allAxis = setAxisPosition(allAxis);
  13420. allAxis = calcAxisLinePosition(allAxis, chart);
  13421. allAxis = calcAxisTickPosition(allAxis);
  13422. allAxis = calcAxisNamePosition(allAxis);
  13423. allAxis = calcSplitLinePosition(allAxis, chart);
  13424. }
  13425. (0, updater_class.doUpdate)({
  13426. chart: chart,
  13427. series: allAxis,
  13428. key: 'axisLine',
  13429. getGraphConfig: getLineConfig
  13430. });
  13431. (0, updater_class.doUpdate)({
  13432. chart: chart,
  13433. series: allAxis,
  13434. key: 'axisTick',
  13435. getGraphConfig: getTickConfig
  13436. });
  13437. (0, updater_class.doUpdate)({
  13438. chart: chart,
  13439. series: allAxis,
  13440. key: 'axisLabel',
  13441. getGraphConfig: getLabelConfig
  13442. });
  13443. (0, updater_class.doUpdate)({
  13444. chart: chart,
  13445. series: allAxis,
  13446. key: 'axisName',
  13447. getGraphConfig: getNameConfig
  13448. });
  13449. (0, updater_class.doUpdate)({
  13450. chart: chart,
  13451. series: allAxis,
  13452. key: 'splitLine',
  13453. getGraphConfig: getSplitLineConfig
  13454. });
  13455. chart.axisData = allAxis;
  13456. }
  13457. function getAllAxis(xAxis, yAxis) {
  13458. var allXAxis = [],
  13459. allYAxis = [];
  13460. if (xAxis instanceof Array) {
  13461. var _allXAxis;
  13462. (_allXAxis = allXAxis).push.apply(_allXAxis, (0, _toConsumableArray2["default"])(xAxis));
  13463. } else {
  13464. allXAxis.push(xAxis);
  13465. }
  13466. if (yAxis instanceof Array) {
  13467. var _allYAxis;
  13468. (_allYAxis = allYAxis).push.apply(_allYAxis, (0, _toConsumableArray2["default"])(yAxis));
  13469. } else {
  13470. allYAxis.push(yAxis);
  13471. }
  13472. allXAxis.splice(2);
  13473. allYAxis.splice(2);
  13474. allXAxis = allXAxis.map(function (axis, i) {
  13475. return _objectSpread({}, axis, {
  13476. index: i,
  13477. axis: 'x'
  13478. });
  13479. });
  13480. allYAxis = allYAxis.map(function (axis, i) {
  13481. return _objectSpread({}, axis, {
  13482. index: i,
  13483. axis: 'y'
  13484. });
  13485. });
  13486. return [].concat((0, _toConsumableArray2["default"])(allXAxis), (0, _toConsumableArray2["default"])(allYAxis));
  13487. }
  13488. function mergeDefaultAxisConfig(allAxis) {
  13489. var xAxis = allAxis.filter(function (_ref2) {
  13490. var axis = _ref2.axis;
  13491. return axis === 'x';
  13492. });
  13493. var yAxis = allAxis.filter(function (_ref3) {
  13494. var axis = _ref3.axis;
  13495. return axis === 'y';
  13496. });
  13497. xAxis = xAxis.map(function (axis) {
  13498. return (0, util$1.deepMerge)((0, util.deepClone)(config.xAxisConfig), axis);
  13499. });
  13500. yAxis = yAxis.map(function (axis) {
  13501. return (0, util$1.deepMerge)((0, util.deepClone)(config.yAxisConfig), axis);
  13502. });
  13503. return [].concat((0, _toConsumableArray2["default"])(xAxis), (0, _toConsumableArray2["default"])(yAxis));
  13504. }
  13505. function mergeDefaultBoundaryGap(allAxis) {
  13506. var valueAxis = allAxis.filter(function (_ref4) {
  13507. var data = _ref4.data;
  13508. return data === 'value';
  13509. });
  13510. var labelAxis = allAxis.filter(function (_ref5) {
  13511. var data = _ref5.data;
  13512. return data !== 'value';
  13513. });
  13514. valueAxis.forEach(function (axis) {
  13515. if (typeof axis.boundaryGap === 'boolean') return;
  13516. axis.boundaryGap = false;
  13517. });
  13518. labelAxis.forEach(function (axis) {
  13519. if (typeof axis.boundaryGap === 'boolean') return;
  13520. axis.boundaryGap = true;
  13521. });
  13522. return [].concat((0, _toConsumableArray2["default"])(valueAxis), (0, _toConsumableArray2["default"])(labelAxis));
  13523. }
  13524. function calcAxisLabelData(allAxis, series) {
  13525. var valueAxis = allAxis.filter(function (_ref6) {
  13526. var data = _ref6.data;
  13527. return data === 'value';
  13528. });
  13529. var labelAxis = allAxis.filter(function (_ref7) {
  13530. var data = _ref7.data;
  13531. return data instanceof Array;
  13532. });
  13533. valueAxis = calcValueAxisLabelData(valueAxis, series);
  13534. labelAxis = calcLabelAxisLabelData(labelAxis);
  13535. return [].concat((0, _toConsumableArray2["default"])(valueAxis), (0, _toConsumableArray2["default"])(labelAxis));
  13536. }
  13537. function calcValueAxisLabelData(valueAxis, series) {
  13538. return valueAxis.map(function (axis) {
  13539. var minMaxValue = getValueAxisMaxMinValue(axis, series);
  13540. var _getTrueMinMax = getTrueMinMax(axis, minMaxValue),
  13541. _getTrueMinMax2 = (0, _slicedToArray2["default"])(_getTrueMinMax, 2),
  13542. min = _getTrueMinMax2[0],
  13543. max = _getTrueMinMax2[1];
  13544. var interval = getValueInterval(min, max, axis);
  13545. var formatter = axis.axisLabel.formatter;
  13546. var label = [];
  13547. if (min < 0 && max > 0) {
  13548. label = getValueAxisLabelFromZero(min, max, interval);
  13549. } else {
  13550. label = getValueAxisLabelFromMin(min, max, interval);
  13551. }
  13552. label = label.map(function (l) {
  13553. return parseFloat(l.toFixed(2));
  13554. });
  13555. return _objectSpread({}, axis, {
  13556. maxValue: label.slice(-1)[0],
  13557. minValue: label[0],
  13558. label: getAfterFormatterLabel(label, formatter)
  13559. });
  13560. });
  13561. }
  13562. function getValueAxisMaxMinValue(axis, series) {
  13563. series = series.filter(function (_ref8) {
  13564. var show = _ref8.show,
  13565. type = _ref8.type;
  13566. if (show === false) return false;
  13567. if (type === 'pie') return false;
  13568. return true;
  13569. });
  13570. if (series.length === 0) return [0, 0];
  13571. var index = axis.index,
  13572. axisType = axis.axis;
  13573. series = mergeStackData(series);
  13574. var axisName = axisType + 'Axis';
  13575. var valueSeries = series.filter(function (s) {
  13576. return s[axisName] === index;
  13577. });
  13578. if (!valueSeries.length) valueSeries = series;
  13579. return getSeriesMinMaxValue(valueSeries);
  13580. }
  13581. function getSeriesMinMaxValue(series) {
  13582. if (!series) return;
  13583. var minValue = Math.min.apply(Math, (0, _toConsumableArray2["default"])(series.map(function (_ref9) {
  13584. var data = _ref9.data;
  13585. return Math.min.apply(Math, (0, _toConsumableArray2["default"])((0, util$1.filterNonNumber)(data)));
  13586. })));
  13587. var maxValue = Math.max.apply(Math, (0, _toConsumableArray2["default"])(series.map(function (_ref10) {
  13588. var data = _ref10.data;
  13589. return Math.max.apply(Math, (0, _toConsumableArray2["default"])((0, util$1.filterNonNumber)(data)));
  13590. })));
  13591. return [minValue, maxValue];
  13592. }
  13593. function mergeStackData(series) {
  13594. var seriesCloned = (0, util.deepClone)(series, true);
  13595. series.forEach(function (item, i) {
  13596. var data = (0, util$1.mergeSameStackData)(item, series);
  13597. seriesCloned[i].data = data;
  13598. });
  13599. return seriesCloned;
  13600. }
  13601. function getTrueMinMax(_ref11, _ref12) {
  13602. var min = _ref11.min,
  13603. max = _ref11.max,
  13604. axis = _ref11.axis;
  13605. var _ref13 = (0, _slicedToArray2["default"])(_ref12, 2),
  13606. minValue = _ref13[0],
  13607. maxValue = _ref13[1];
  13608. var minType = (0, _typeof2["default"])(min),
  13609. maxType = (0, _typeof2["default"])(max);
  13610. if (!testMinMaxType(min)) {
  13611. min = axisConfig[axis + 'AxisConfig'].min;
  13612. minType = 'string';
  13613. }
  13614. if (!testMinMaxType(max)) {
  13615. max = axisConfig[axis + 'AxisConfig'].max;
  13616. maxType = 'string';
  13617. }
  13618. if (minType === 'string') {
  13619. min = parseInt(minValue - abs(minValue * parseFloat(min) / 100));
  13620. var lever = getValueLever(min);
  13621. min = parseFloat((min / lever - 0.1).toFixed(1)) * lever;
  13622. }
  13623. if (maxType === 'string') {
  13624. max = parseInt(maxValue + abs(maxValue * parseFloat(max) / 100));
  13625. var _lever = getValueLever(max);
  13626. max = parseFloat((max / _lever + 0.1).toFixed(1)) * _lever;
  13627. }
  13628. return [min, max];
  13629. }
  13630. function getValueLever(value) {
  13631. var valueString = abs(value).toString();
  13632. var valueLength = valueString.length;
  13633. var firstZeroIndex = valueString.replace(/0*$/g, '').indexOf('0');
  13634. var pow10Num = valueLength - 1;
  13635. if (firstZeroIndex !== -1) pow10Num -= firstZeroIndex;
  13636. return pow(10, pow10Num);
  13637. }
  13638. function testMinMaxType(val) {
  13639. var valType = (0, _typeof2["default"])(val);
  13640. var isValidString = valType === 'string' && /^\d+%$/.test(val);
  13641. var isValidNumber = valType === 'number';
  13642. return isValidString || isValidNumber;
  13643. }
  13644. function getValueAxisLabelFromZero(min, max, interval) {
  13645. var negative = [],
  13646. positive = [];
  13647. var currentNegative = 0,
  13648. currentPositive = 0;
  13649. do {
  13650. negative.push(currentNegative -= interval);
  13651. } while (currentNegative > min);
  13652. do {
  13653. positive.push(currentPositive += interval);
  13654. } while (currentPositive < max);
  13655. return [].concat((0, _toConsumableArray2["default"])(negative.reverse()), [0], (0, _toConsumableArray2["default"])(positive));
  13656. }
  13657. function getValueAxisLabelFromMin(min, max, interval) {
  13658. var label = [min],
  13659. currentValue = min;
  13660. do {
  13661. label.push(currentValue += interval);
  13662. } while (currentValue < max);
  13663. return label;
  13664. }
  13665. function getAfterFormatterLabel(label, formatter) {
  13666. if (!formatter) return label;
  13667. if (typeof formatter === 'string') label = label.map(function (l) {
  13668. return formatter.replace('{value}', l);
  13669. });
  13670. if (typeof formatter === 'function') label = label.map(function (value, index) {
  13671. return formatter({
  13672. value: value,
  13673. index: index
  13674. });
  13675. });
  13676. return label;
  13677. }
  13678. function calcLabelAxisLabelData(labelAxis) {
  13679. return labelAxis.map(function (axis) {
  13680. var data = axis.data,
  13681. formatter = axis.axisLabel.formatter;
  13682. return _objectSpread({}, axis, {
  13683. label: getAfterFormatterLabel(data, formatter)
  13684. });
  13685. });
  13686. }
  13687. function getValueInterval(min, max, axis) {
  13688. var interval = axis.interval,
  13689. minInterval = axis.minInterval,
  13690. maxInterval = axis.maxInterval,
  13691. splitNumber = axis.splitNumber,
  13692. axisType = axis.axis;
  13693. var config = axisConfig[axisType + 'AxisConfig'];
  13694. if (typeof interval !== 'number') interval = config.interval;
  13695. if (typeof minInterval !== 'number') minInterval = config.minInterval;
  13696. if (typeof maxInterval !== 'number') maxInterval = config.maxInterval;
  13697. if (typeof splitNumber !== 'number') splitNumber = config.splitNumber;
  13698. if (typeof interval === 'number') return interval;
  13699. var valueInterval = parseInt((max - min) / (splitNumber - 1));
  13700. if (valueInterval.toString().length > 1) valueInterval = parseInt(valueInterval.toString().replace(/\d$/, '0'));
  13701. if (valueInterval === 0) valueInterval = 1;
  13702. if (typeof minInterval === 'number' && valueInterval < minInterval) return minInterval;
  13703. if (typeof maxInterval === 'number' && valueInterval > maxInterval) return maxInterval;
  13704. return valueInterval;
  13705. }
  13706. function setAxisPosition(allAxis) {
  13707. var xAxis = allAxis.filter(function (_ref14) {
  13708. var axis = _ref14.axis;
  13709. return axis === 'x';
  13710. });
  13711. var yAxis = allAxis.filter(function (_ref15) {
  13712. var axis = _ref15.axis;
  13713. return axis === 'y';
  13714. });
  13715. if (xAxis[0] && !xAxis[0].position) xAxis[0].position = config.xAxisConfig.position;
  13716. if (xAxis[1] && !xAxis[1].position) {
  13717. xAxis[1].position = xAxis[0].position === 'bottom' ? 'top' : 'bottom';
  13718. }
  13719. if (yAxis[0] && !yAxis[0].position) yAxis[0].position = config.yAxisConfig.position;
  13720. if (yAxis[1] && !yAxis[1].position) {
  13721. yAxis[1].position = yAxis[0].position === 'left' ? 'right' : 'left';
  13722. }
  13723. return [].concat((0, _toConsumableArray2["default"])(xAxis), (0, _toConsumableArray2["default"])(yAxis));
  13724. }
  13725. function calcAxisLinePosition(allAxis, chart) {
  13726. var _chart$gridArea = chart.gridArea,
  13727. x = _chart$gridArea.x,
  13728. y = _chart$gridArea.y,
  13729. w = _chart$gridArea.w,
  13730. h = _chart$gridArea.h;
  13731. allAxis = allAxis.map(function (axis) {
  13732. var position = axis.position;
  13733. var linePosition = [];
  13734. if (position === 'left') {
  13735. linePosition = [[x, y], [x, y + h]].reverse();
  13736. } else if (position === 'right') {
  13737. linePosition = [[x + w, y], [x + w, y + h]].reverse();
  13738. } else if (position === 'top') {
  13739. linePosition = [[x, y], [x + w, y]];
  13740. } else if (position === 'bottom') {
  13741. linePosition = [[x, y + h], [x + w, y + h]];
  13742. }
  13743. return _objectSpread({}, axis, {
  13744. linePosition: linePosition
  13745. });
  13746. });
  13747. return allAxis;
  13748. }
  13749. function calcAxisTickPosition(allAxis, chart) {
  13750. return allAxis.map(function (axisItem) {
  13751. var axis = axisItem.axis,
  13752. linePosition = axisItem.linePosition,
  13753. position = axisItem.position,
  13754. label = axisItem.label,
  13755. boundaryGap = axisItem.boundaryGap;
  13756. if (typeof boundaryGap !== 'boolean') boundaryGap = axisConfig[axis + 'AxisConfig'].boundaryGap;
  13757. var labelNum = label.length;
  13758. var _linePosition = (0, _slicedToArray2["default"])(linePosition, 2),
  13759. _linePosition$ = (0, _slicedToArray2["default"])(_linePosition[0], 2),
  13760. startX = _linePosition$[0],
  13761. startY = _linePosition$[1],
  13762. _linePosition$2 = (0, _slicedToArray2["default"])(_linePosition[1], 2),
  13763. endX = _linePosition$2[0],
  13764. endY = _linePosition$2[1];
  13765. var gapLength = axis === 'x' ? endX - startX : endY - startY;
  13766. var gap = gapLength / (boundaryGap ? labelNum : labelNum - 1);
  13767. var tickPosition = new Array(labelNum).fill(0).map(function (foo, i) {
  13768. if (axis === 'x') {
  13769. return [startX + gap * (boundaryGap ? i + 0.5 : i), startY];
  13770. }
  13771. return [startX, startY + gap * (boundaryGap ? i + 0.5 : i)];
  13772. });
  13773. var tickLinePosition = getTickLinePosition(axis, boundaryGap, position, tickPosition, gap);
  13774. return _objectSpread({}, axisItem, {
  13775. tickPosition: tickPosition,
  13776. tickLinePosition: tickLinePosition,
  13777. tickGap: gap
  13778. });
  13779. });
  13780. }
  13781. function getTickLinePosition(axisType, boundaryGap, position, tickPosition, gap) {
  13782. var index = axisType === 'x' ? 1 : 0;
  13783. var plus = 5;
  13784. if (axisType === 'x' && position === 'top') plus = -5;
  13785. if (axisType === 'y' && position === 'left') plus = -5;
  13786. var tickLinePosition = tickPosition.map(function (lineStart) {
  13787. var lineEnd = (0, util.deepClone)(lineStart);
  13788. lineEnd[index] += plus;
  13789. return [(0, util.deepClone)(lineStart), lineEnd];
  13790. });
  13791. if (!boundaryGap) return tickLinePosition;
  13792. index = axisType === 'x' ? 0 : 1;
  13793. plus = gap / 2;
  13794. tickLinePosition.forEach(function (_ref16) {
  13795. var _ref17 = (0, _slicedToArray2["default"])(_ref16, 2),
  13796. lineStart = _ref17[0],
  13797. lineEnd = _ref17[1];
  13798. lineStart[index] += plus;
  13799. lineEnd[index] += plus;
  13800. });
  13801. return tickLinePosition;
  13802. }
  13803. function calcAxisNamePosition(allAxis, chart) {
  13804. return allAxis.map(function (axisItem) {
  13805. var nameGap = axisItem.nameGap,
  13806. nameLocation = axisItem.nameLocation,
  13807. position = axisItem.position,
  13808. linePosition = axisItem.linePosition;
  13809. var _linePosition2 = (0, _slicedToArray2["default"])(linePosition, 2),
  13810. lineStart = _linePosition2[0],
  13811. lineEnd = _linePosition2[1];
  13812. var namePosition = (0, _toConsumableArray2["default"])(lineStart);
  13813. if (nameLocation === 'end') namePosition = (0, _toConsumableArray2["default"])(lineEnd);
  13814. if (nameLocation === 'center') {
  13815. namePosition[0] = (lineStart[0] + lineEnd[0]) / 2;
  13816. namePosition[1] = (lineStart[1] + lineEnd[1]) / 2;
  13817. }
  13818. var index = 0;
  13819. if (position === 'top' && nameLocation === 'center') index = 1;
  13820. if (position === 'bottom' && nameLocation === 'center') index = 1;
  13821. if (position === 'left' && nameLocation !== 'center') index = 1;
  13822. if (position === 'right' && nameLocation !== 'center') index = 1;
  13823. var plus = nameGap;
  13824. if (position === 'top' && nameLocation !== 'end') plus *= -1;
  13825. if (position === 'left' && nameLocation !== 'start') plus *= -1;
  13826. if (position === 'bottom' && nameLocation === 'start') plus *= -1;
  13827. if (position === 'right' && nameLocation === 'end') plus *= -1;
  13828. namePosition[index] += plus;
  13829. return _objectSpread({}, axisItem, {
  13830. namePosition: namePosition
  13831. });
  13832. });
  13833. }
  13834. function calcSplitLinePosition(allAxis, chart) {
  13835. var _chart$gridArea2 = chart.gridArea,
  13836. w = _chart$gridArea2.w,
  13837. h = _chart$gridArea2.h;
  13838. return allAxis.map(function (axisItem) {
  13839. var tickLinePosition = axisItem.tickLinePosition,
  13840. position = axisItem.position,
  13841. boundaryGap = axisItem.boundaryGap;
  13842. var index = 0,
  13843. plus = w;
  13844. if (position === 'top' || position === 'bottom') index = 1;
  13845. if (position === 'top' || position === 'bottom') plus = h;
  13846. if (position === 'right' || position === 'bottom') plus *= -1;
  13847. var splitLinePosition = tickLinePosition.map(function (_ref18) {
  13848. var _ref19 = (0, _slicedToArray2["default"])(_ref18, 1),
  13849. startPoint = _ref19[0];
  13850. var endPoint = (0, _toConsumableArray2["default"])(startPoint);
  13851. endPoint[index] += plus;
  13852. return [(0, _toConsumableArray2["default"])(startPoint), endPoint];
  13853. });
  13854. if (!boundaryGap) splitLinePosition.shift();
  13855. return _objectSpread({}, axisItem, {
  13856. splitLinePosition: splitLinePosition
  13857. });
  13858. });
  13859. }
  13860. function getLineConfig(axisItem) {
  13861. var animationCurve = axisItem.animationCurve,
  13862. animationFrame = axisItem.animationFrame,
  13863. rLevel = axisItem.rLevel;
  13864. return [{
  13865. name: 'polyline',
  13866. index: rLevel,
  13867. visible: axisItem.axisLine.show,
  13868. animationCurve: animationCurve,
  13869. animationFrame: animationFrame,
  13870. shape: getLineShape(axisItem),
  13871. style: getLineStyle(axisItem)
  13872. }];
  13873. }
  13874. function getLineShape(axisItem) {
  13875. var linePosition = axisItem.linePosition;
  13876. return {
  13877. points: linePosition
  13878. };
  13879. }
  13880. function getLineStyle(axisItem) {
  13881. return axisItem.axisLine.style;
  13882. }
  13883. function getTickConfig(axisItem) {
  13884. var animationCurve = axisItem.animationCurve,
  13885. animationFrame = axisItem.animationFrame,
  13886. rLevel = axisItem.rLevel;
  13887. var shapes = getTickShapes(axisItem);
  13888. var style = getTickStyle(axisItem);
  13889. return shapes.map(function (shape) {
  13890. return {
  13891. name: 'polyline',
  13892. index: rLevel,
  13893. visible: axisItem.axisTick.show,
  13894. animationCurve: animationCurve,
  13895. animationFrame: animationFrame,
  13896. shape: shape,
  13897. style: style
  13898. };
  13899. });
  13900. }
  13901. function getTickShapes(axisItem) {
  13902. var tickLinePosition = axisItem.tickLinePosition;
  13903. return tickLinePosition.map(function (points) {
  13904. return {
  13905. points: points
  13906. };
  13907. });
  13908. }
  13909. function getTickStyle(axisItem) {
  13910. return axisItem.axisTick.style;
  13911. }
  13912. function getLabelConfig(axisItem) {
  13913. var animationCurve = axisItem.animationCurve,
  13914. animationFrame = axisItem.animationFrame,
  13915. rLevel = axisItem.rLevel;
  13916. var shapes = getLabelShapes(axisItem);
  13917. var styles = getLabelStyle(axisItem, shapes);
  13918. return shapes.map(function (shape, i) {
  13919. return {
  13920. name: 'text',
  13921. index: rLevel,
  13922. visible: axisItem.axisLabel.show,
  13923. animationCurve: animationCurve,
  13924. animationFrame: animationFrame,
  13925. shape: shape,
  13926. style: styles[i],
  13927. setGraphCenter: function setGraphCenter() {
  13928. return void 0;
  13929. }
  13930. };
  13931. });
  13932. }
  13933. function getLabelShapes(axisItem) {
  13934. var label = axisItem.label,
  13935. tickPosition = axisItem.tickPosition,
  13936. position = axisItem.position;
  13937. return tickPosition.map(function (point, i) {
  13938. return {
  13939. position: getLabelRealPosition(point, position),
  13940. content: label[i].toString()
  13941. };
  13942. });
  13943. }
  13944. function getLabelRealPosition(points, position) {
  13945. var index = 0,
  13946. plus = 10;
  13947. if (position === 'top' || position === 'bottom') index = 1;
  13948. if (position === 'top' || position === 'left') plus = -10;
  13949. points = (0, util.deepClone)(points);
  13950. points[index] += plus;
  13951. return points;
  13952. }
  13953. function getLabelStyle(axisItem, shapes) {
  13954. var position = axisItem.position;
  13955. var style = axisItem.axisLabel.style;
  13956. var align = getAxisLabelRealAlign(position);
  13957. style = (0, util$1.deepMerge)(align, style);
  13958. var styles = shapes.map(function (_ref20) {
  13959. var position = _ref20.position;
  13960. return _objectSpread({}, style, {
  13961. graphCenter: position
  13962. });
  13963. });
  13964. return styles;
  13965. }
  13966. function getAxisLabelRealAlign(position) {
  13967. if (position === 'left') return {
  13968. textAlign: 'right',
  13969. textBaseline: 'middle'
  13970. };
  13971. if (position === 'right') return {
  13972. textAlign: 'left',
  13973. textBaseline: 'middle'
  13974. };
  13975. if (position === 'top') return {
  13976. textAlign: 'center',
  13977. textBaseline: 'bottom'
  13978. };
  13979. if (position === 'bottom') return {
  13980. textAlign: 'center',
  13981. textBaseline: 'top'
  13982. };
  13983. }
  13984. function getNameConfig(axisItem) {
  13985. var animationCurve = axisItem.animationCurve,
  13986. animationFrame = axisItem.animationFrame,
  13987. rLevel = axisItem.rLevel;
  13988. return [{
  13989. name: 'text',
  13990. index: rLevel,
  13991. animationCurve: animationCurve,
  13992. animationFrame: animationFrame,
  13993. shape: getNameShape(axisItem),
  13994. style: getNameStyle(axisItem)
  13995. }];
  13996. }
  13997. function getNameShape(axisItem) {
  13998. var name = axisItem.name,
  13999. namePosition = axisItem.namePosition;
  14000. return {
  14001. content: name,
  14002. position: namePosition
  14003. };
  14004. }
  14005. function getNameStyle(axisItem) {
  14006. var nameLocation = axisItem.nameLocation,
  14007. position = axisItem.position,
  14008. style = axisItem.nameTextStyle;
  14009. var align = getNameRealAlign(position, nameLocation);
  14010. return (0, util$1.deepMerge)(align, style);
  14011. }
  14012. function getNameRealAlign(position, location) {
  14013. if (position === 'top' && location === 'start' || position === 'bottom' && location === 'start' || position === 'left' && location === 'center') return {
  14014. textAlign: 'right',
  14015. textBaseline: 'middle'
  14016. };
  14017. if (position === 'top' && location === 'end' || position === 'bottom' && location === 'end' || position === 'right' && location === 'center') return {
  14018. textAlign: 'left',
  14019. textBaseline: 'middle'
  14020. };
  14021. if (position === 'top' && location === 'center' || position === 'left' && location === 'end' || position === 'right' && location === 'end') return {
  14022. textAlign: 'center',
  14023. textBaseline: 'bottom'
  14024. };
  14025. if (position === 'bottom' && location === 'center' || position === 'left' && location === 'start' || position === 'right' && location === 'start') return {
  14026. textAlign: 'center',
  14027. textBaseline: 'top'
  14028. };
  14029. }
  14030. function getSplitLineConfig(axisItem) {
  14031. var animationCurve = axisItem.animationCurve,
  14032. animationFrame = axisItem.animationFrame,
  14033. rLevel = axisItem.rLevel;
  14034. var shapes = getSplitLineShapes(axisItem);
  14035. var style = getSplitLineStyle(axisItem);
  14036. return shapes.map(function (shape) {
  14037. return {
  14038. name: 'polyline',
  14039. index: rLevel,
  14040. visible: axisItem.splitLine.show,
  14041. animationCurve: animationCurve,
  14042. animationFrame: animationFrame,
  14043. shape: shape,
  14044. style: style
  14045. };
  14046. });
  14047. }
  14048. function getSplitLineShapes(axisItem) {
  14049. var splitLinePosition = axisItem.splitLinePosition;
  14050. return splitLinePosition.map(function (points) {
  14051. return {
  14052. points: points
  14053. };
  14054. });
  14055. }
  14056. function getSplitLineStyle(axisItem) {
  14057. return axisItem.splitLine.style;
  14058. }
  14059. });
  14060. unwrapExports(axis_1$1);
  14061. var axis_2$1 = axis_1$1.axis;
  14062. var line_1$1 = createCommonjsModule(function (module, exports) {
  14063. Object.defineProperty(exports, "__esModule", {
  14064. value: true
  14065. });
  14066. exports.line = line;
  14067. var _typeof2 = interopRequireDefault(_typeof_1);
  14068. var _slicedToArray2 = interopRequireDefault(slicedToArray);
  14069. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  14070. var _defineProperty2 = interopRequireDefault(defineProperty);
  14071. var _bezierCurve = interopRequireDefault(lib$1);
  14072. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  14073. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  14074. var polylineToBezierCurve = _bezierCurve["default"].polylineToBezierCurve,
  14075. getBezierCurveLength = _bezierCurve["default"].getBezierCurveLength;
  14076. function line(chart) {
  14077. var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  14078. var xAxis = option.xAxis,
  14079. yAxis = option.yAxis,
  14080. series = option.series;
  14081. var lines = [];
  14082. if (xAxis && yAxis && series) {
  14083. lines = (0, util$1.initNeedSeries)(series, config.lineConfig, 'line');
  14084. lines = calcLinesPosition(lines, chart);
  14085. }
  14086. (0, updater_class.doUpdate)({
  14087. chart: chart,
  14088. series: lines,
  14089. key: 'lineArea',
  14090. getGraphConfig: getLineAreaConfig,
  14091. getStartGraphConfig: getStartLineAreaConfig,
  14092. beforeUpdate: beforeUpdateLineAndArea,
  14093. beforeChange: beforeChangeLineAndArea
  14094. });
  14095. (0, updater_class.doUpdate)({
  14096. chart: chart,
  14097. series: lines,
  14098. key: 'line',
  14099. getGraphConfig: getLineConfig,
  14100. getStartGraphConfig: getStartLineConfig,
  14101. beforeUpdate: beforeUpdateLineAndArea,
  14102. beforeChange: beforeChangeLineAndArea
  14103. });
  14104. (0, updater_class.doUpdate)({
  14105. chart: chart,
  14106. series: lines,
  14107. key: 'linePoint',
  14108. getGraphConfig: getPointConfig,
  14109. getStartGraphConfig: getStartPointConfig
  14110. });
  14111. (0, updater_class.doUpdate)({
  14112. chart: chart,
  14113. series: lines,
  14114. key: 'lineLabel',
  14115. getGraphConfig: getLabelConfig
  14116. });
  14117. }
  14118. function calcLinesPosition(lines, chart) {
  14119. var axisData = chart.axisData;
  14120. return lines.map(function (lineItem) {
  14121. var lineData = (0, util$1.mergeSameStackData)(lineItem, lines);
  14122. lineData = mergeNonNumber(lineItem, lineData);
  14123. var lineAxis = getLineAxis(lineItem, axisData);
  14124. var linePosition = getLinePosition(lineData, lineAxis);
  14125. var lineFillBottomPos = getLineFillBottomPos(lineAxis);
  14126. return _objectSpread({}, lineItem, {
  14127. linePosition: linePosition.filter(function (p) {
  14128. return p;
  14129. }),
  14130. lineFillBottomPos: lineFillBottomPos
  14131. });
  14132. });
  14133. }
  14134. function mergeNonNumber(lineItem, lineData) {
  14135. var data = lineItem.data;
  14136. return lineData.map(function (v, i) {
  14137. return typeof data[i] === 'number' ? v : null;
  14138. });
  14139. }
  14140. function getLineAxis(line, axisData) {
  14141. var xAxisIndex = line.xAxisIndex,
  14142. yAxisIndex = line.yAxisIndex;
  14143. var xAxis = axisData.find(function (_ref) {
  14144. var axis = _ref.axis,
  14145. index = _ref.index;
  14146. return axis === 'x' && index === xAxisIndex;
  14147. });
  14148. var yAxis = axisData.find(function (_ref2) {
  14149. var axis = _ref2.axis,
  14150. index = _ref2.index;
  14151. return axis === 'y' && index === yAxisIndex;
  14152. });
  14153. return [xAxis, yAxis];
  14154. }
  14155. function getLinePosition(lineData, lineAxis) {
  14156. var valueAxisIndex = lineAxis.findIndex(function (_ref3) {
  14157. var data = _ref3.data;
  14158. return data === 'value';
  14159. });
  14160. var valueAxis = lineAxis[valueAxisIndex];
  14161. var labelAxis = lineAxis[1 - valueAxisIndex];
  14162. var linePosition = valueAxis.linePosition,
  14163. axis = valueAxis.axis;
  14164. var tickPosition = labelAxis.tickPosition;
  14165. var tickNum = tickPosition.length;
  14166. var valueAxisPosIndex = axis === 'x' ? 0 : 1;
  14167. var valueAxisStartPos = linePosition[0][valueAxisPosIndex];
  14168. var valueAxisEndPos = linePosition[1][valueAxisPosIndex];
  14169. var valueAxisPosMinus = valueAxisEndPos - valueAxisStartPos;
  14170. var maxValue = valueAxis.maxValue,
  14171. minValue = valueAxis.minValue;
  14172. var valueMinus = maxValue - minValue;
  14173. var position = new Array(tickNum).fill(0).map(function (foo, i) {
  14174. var v = lineData[i];
  14175. if (typeof v !== 'number') return null;
  14176. var valuePercent = (v - minValue) / valueMinus;
  14177. if (valueMinus === 0) valuePercent = 0;
  14178. return valuePercent * valueAxisPosMinus + valueAxisStartPos;
  14179. });
  14180. return position.map(function (vPos, i) {
  14181. if (i >= tickNum || typeof vPos !== 'number') return null;
  14182. var pos = [vPos, tickPosition[i][1 - valueAxisPosIndex]];
  14183. if (valueAxisPosIndex === 0) return pos;
  14184. pos.reverse();
  14185. return pos;
  14186. });
  14187. }
  14188. function getLineFillBottomPos(lineAxis) {
  14189. var valueAxis = lineAxis.find(function (_ref4) {
  14190. var data = _ref4.data;
  14191. return data === 'value';
  14192. });
  14193. var axis = valueAxis.axis,
  14194. linePosition = valueAxis.linePosition,
  14195. minValue = valueAxis.minValue,
  14196. maxValue = valueAxis.maxValue;
  14197. var changeIndex = axis === 'x' ? 0 : 1;
  14198. var changeValue = linePosition[0][changeIndex];
  14199. if (minValue < 0 && maxValue > 0) {
  14200. var valueMinus = maxValue - minValue;
  14201. var posMinus = Math.abs(linePosition[0][changeIndex] - linePosition[1][changeIndex]);
  14202. var offset = Math.abs(minValue) / valueMinus * posMinus;
  14203. if (axis === 'y') offset *= -1;
  14204. changeValue += offset;
  14205. }
  14206. return {
  14207. changeIndex: changeIndex,
  14208. changeValue: changeValue
  14209. };
  14210. }
  14211. function getLineAreaConfig(lineItem) {
  14212. var animationCurve = lineItem.animationCurve,
  14213. animationFrame = lineItem.animationFrame,
  14214. lineFillBottomPos = lineItem.lineFillBottomPos,
  14215. rLevel = lineItem.rLevel;
  14216. return [{
  14217. name: getLineGraphName(lineItem),
  14218. index: rLevel,
  14219. animationCurve: animationCurve,
  14220. animationFrame: animationFrame,
  14221. visible: lineItem.lineArea.show,
  14222. lineFillBottomPos: lineFillBottomPos,
  14223. shape: getLineAndAreaShape(lineItem),
  14224. style: getLineAreaStyle(lineItem),
  14225. drawed: lineAreaDrawed
  14226. }];
  14227. }
  14228. function getLineAndAreaShape(lineItem) {
  14229. var linePosition = lineItem.linePosition;
  14230. return {
  14231. points: linePosition
  14232. };
  14233. }
  14234. function getLineAreaStyle(lineItem) {
  14235. var lineArea = lineItem.lineArea,
  14236. color = lineItem.color;
  14237. var gradient = lineArea.gradient,
  14238. style = lineArea.style;
  14239. var fillColor = [style.fill || color];
  14240. var gradientColor = (0, util$1.deepMerge)(fillColor, gradient);
  14241. if (gradientColor.length === 1) gradientColor.push(gradientColor[0]);
  14242. var gradientParams = getGradientParams(lineItem);
  14243. style = _objectSpread({}, style, {
  14244. stroke: 'rgba(0, 0, 0, 0)'
  14245. });
  14246. return (0, util$1.deepMerge)({
  14247. gradientColor: gradientColor,
  14248. gradientParams: gradientParams,
  14249. gradientType: 'linear',
  14250. gradientWith: 'fill'
  14251. }, style);
  14252. }
  14253. function getGradientParams(lineItem) {
  14254. var lineFillBottomPos = lineItem.lineFillBottomPos,
  14255. linePosition = lineItem.linePosition;
  14256. var changeIndex = lineFillBottomPos.changeIndex,
  14257. changeValue = lineFillBottomPos.changeValue;
  14258. var mainPos = linePosition.map(function (p) {
  14259. return p[changeIndex];
  14260. });
  14261. var maxPos = Math.max.apply(Math, (0, _toConsumableArray2["default"])(mainPos));
  14262. var minPos = Math.min.apply(Math, (0, _toConsumableArray2["default"])(mainPos));
  14263. var beginPos = maxPos;
  14264. if (changeIndex === 1) beginPos = minPos;
  14265. if (changeIndex === 1) {
  14266. return [0, beginPos, 0, changeValue];
  14267. } else {
  14268. return [beginPos, 0, changeValue, 0];
  14269. }
  14270. }
  14271. function lineAreaDrawed(_ref5, _ref6) {
  14272. var lineFillBottomPos = _ref5.lineFillBottomPos,
  14273. shape = _ref5.shape;
  14274. var ctx = _ref6.ctx;
  14275. var points = shape.points;
  14276. var changeIndex = lineFillBottomPos.changeIndex,
  14277. changeValue = lineFillBottomPos.changeValue;
  14278. var linePoint1 = (0, _toConsumableArray2["default"])(points[points.length - 1]);
  14279. var linePoint2 = (0, _toConsumableArray2["default"])(points[0]);
  14280. linePoint1[changeIndex] = changeValue;
  14281. linePoint2[changeIndex] = changeValue;
  14282. ctx.lineTo.apply(ctx, (0, _toConsumableArray2["default"])(linePoint1));
  14283. ctx.lineTo.apply(ctx, (0, _toConsumableArray2["default"])(linePoint2));
  14284. ctx.closePath();
  14285. ctx.fill();
  14286. }
  14287. function getStartLineAreaConfig(lineItem) {
  14288. var config = getLineAreaConfig(lineItem)[0];
  14289. var style = _objectSpread({}, config.style);
  14290. style.opacity = 0;
  14291. config.style = style;
  14292. return [config];
  14293. }
  14294. function beforeUpdateLineAndArea(graphs, lineItem, i, updater) {
  14295. var cache = graphs[i];
  14296. if (!cache) return;
  14297. var currentName = getLineGraphName(lineItem);
  14298. var render = updater.chart.render;
  14299. var name = cache[0].name;
  14300. var delAll = currentName !== name;
  14301. if (!delAll) return;
  14302. cache.forEach(function (g) {
  14303. return render.delGraph(g);
  14304. });
  14305. graphs[i] = null;
  14306. }
  14307. function beforeChangeLineAndArea(graph, config) {
  14308. var points = config.shape.points;
  14309. var graphPoints = graph.shape.points;
  14310. var graphPointsNum = graphPoints.length;
  14311. var pointsNum = points.length;
  14312. if (pointsNum > graphPointsNum) {
  14313. var lastPoint = graphPoints.slice(-1)[0];
  14314. var newAddPoints = new Array(pointsNum - graphPointsNum).fill(0).map(function (foo) {
  14315. return (0, _toConsumableArray2["default"])(lastPoint);
  14316. });
  14317. graphPoints.push.apply(graphPoints, (0, _toConsumableArray2["default"])(newAddPoints));
  14318. } else if (pointsNum < graphPointsNum) {
  14319. graphPoints.splice(pointsNum);
  14320. }
  14321. }
  14322. function getLineConfig(lineItem) {
  14323. var animationCurve = lineItem.animationCurve,
  14324. animationFrame = lineItem.animationFrame,
  14325. rLevel = lineItem.rLevel;
  14326. return [{
  14327. name: getLineGraphName(lineItem),
  14328. index: rLevel + 1,
  14329. animationCurve: animationCurve,
  14330. animationFrame: animationFrame,
  14331. shape: getLineAndAreaShape(lineItem),
  14332. style: getLineStyle(lineItem)
  14333. }];
  14334. }
  14335. function getLineGraphName(lineItem) {
  14336. var smooth = lineItem.smooth;
  14337. return smooth ? 'smoothline' : 'polyline';
  14338. }
  14339. function getLineStyle(lineItem) {
  14340. var lineStyle = lineItem.lineStyle,
  14341. color = lineItem.color,
  14342. smooth = lineItem.smooth,
  14343. linePosition = lineItem.linePosition;
  14344. var lineLength = getLineLength(linePosition, smooth);
  14345. return (0, util$1.deepMerge)({
  14346. stroke: color,
  14347. lineDash: [lineLength, 0]
  14348. }, lineStyle);
  14349. }
  14350. function getLineLength(points) {
  14351. var smooth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  14352. if (!smooth) return (0, util$1.getPolylineLength)(points);
  14353. var curve = polylineToBezierCurve(points);
  14354. return getBezierCurveLength(curve);
  14355. }
  14356. function getStartLineConfig(lineItem) {
  14357. var lineDash = lineItem.lineStyle.lineDash;
  14358. var config = getLineConfig(lineItem)[0];
  14359. var realLineDash = config.style.lineDash;
  14360. if (lineDash) {
  14361. realLineDash = [0, 0];
  14362. } else {
  14363. realLineDash = (0, _toConsumableArray2["default"])(realLineDash).reverse();
  14364. }
  14365. config.style.lineDash = realLineDash;
  14366. return [config];
  14367. }
  14368. function getPointConfig(lineItem) {
  14369. var animationCurve = lineItem.animationCurve,
  14370. animationFrame = lineItem.animationFrame,
  14371. rLevel = lineItem.rLevel;
  14372. var shapes = getPointShapes(lineItem);
  14373. var style = getPointStyle(lineItem);
  14374. return shapes.map(function (shape) {
  14375. return {
  14376. name: 'circle',
  14377. index: rLevel + 2,
  14378. visible: lineItem.linePoint.show,
  14379. animationCurve: animationCurve,
  14380. animationFrame: animationFrame,
  14381. shape: shape,
  14382. style: style
  14383. };
  14384. });
  14385. }
  14386. function getPointShapes(lineItem) {
  14387. var linePosition = lineItem.linePosition,
  14388. radius = lineItem.linePoint.radius;
  14389. return linePosition.map(function (_ref7) {
  14390. var _ref8 = (0, _slicedToArray2["default"])(_ref7, 2),
  14391. rx = _ref8[0],
  14392. ry = _ref8[1];
  14393. return {
  14394. r: radius,
  14395. rx: rx,
  14396. ry: ry
  14397. };
  14398. });
  14399. }
  14400. function getPointStyle(lineItem) {
  14401. var color = lineItem.color,
  14402. style = lineItem.linePoint.style;
  14403. return (0, util$1.deepMerge)({
  14404. stroke: color
  14405. }, style);
  14406. }
  14407. function getStartPointConfig(lineItem) {
  14408. var configs = getPointConfig(lineItem);
  14409. configs.forEach(function (config) {
  14410. config.shape.r = 0.1;
  14411. });
  14412. return configs;
  14413. }
  14414. function getLabelConfig(lineItem) {
  14415. var animationCurve = lineItem.animationCurve,
  14416. animationFrame = lineItem.animationFrame,
  14417. rLevel = lineItem.rLevel;
  14418. var shapes = getLabelShapes(lineItem);
  14419. var style = getLabelStyle(lineItem);
  14420. return shapes.map(function (shape, i) {
  14421. return {
  14422. name: 'text',
  14423. index: rLevel + 3,
  14424. visible: lineItem.label.show,
  14425. animationCurve: animationCurve,
  14426. animationFrame: animationFrame,
  14427. shape: shape,
  14428. style: style
  14429. };
  14430. });
  14431. }
  14432. function getLabelShapes(lineItem) {
  14433. var contents = formatterLabel(lineItem);
  14434. var position = getLabelPosition(lineItem);
  14435. return contents.map(function (content, i) {
  14436. return {
  14437. content: content,
  14438. position: position[i]
  14439. };
  14440. });
  14441. }
  14442. function getLabelPosition(lineItem) {
  14443. var linePosition = lineItem.linePosition,
  14444. lineFillBottomPos = lineItem.lineFillBottomPos,
  14445. label = lineItem.label;
  14446. var position = label.position,
  14447. offset = label.offset;
  14448. var changeIndex = lineFillBottomPos.changeIndex,
  14449. changeValue = lineFillBottomPos.changeValue;
  14450. return linePosition.map(function (pos) {
  14451. if (position === 'bottom') {
  14452. pos = (0, _toConsumableArray2["default"])(pos);
  14453. pos[changeIndex] = changeValue;
  14454. }
  14455. if (position === 'center') {
  14456. var bottom = (0, _toConsumableArray2["default"])(pos);
  14457. bottom[changeIndex] = changeValue;
  14458. pos = getCenterLabelPoint(pos, bottom);
  14459. }
  14460. return getOffsetedPoint(pos, offset);
  14461. });
  14462. }
  14463. function getOffsetedPoint(_ref9, _ref10) {
  14464. var _ref11 = (0, _slicedToArray2["default"])(_ref9, 2),
  14465. x = _ref11[0],
  14466. y = _ref11[1];
  14467. var _ref12 = (0, _slicedToArray2["default"])(_ref10, 2),
  14468. ox = _ref12[0],
  14469. oy = _ref12[1];
  14470. return [x + ox, y + oy];
  14471. }
  14472. function getCenterLabelPoint(_ref13, _ref14) {
  14473. var _ref15 = (0, _slicedToArray2["default"])(_ref13, 2),
  14474. ax = _ref15[0],
  14475. ay = _ref15[1];
  14476. var _ref16 = (0, _slicedToArray2["default"])(_ref14, 2),
  14477. bx = _ref16[0],
  14478. by = _ref16[1];
  14479. return [(ax + bx) / 2, (ay + by) / 2];
  14480. }
  14481. function formatterLabel(lineItem) {
  14482. var data = lineItem.data,
  14483. formatter = lineItem.label.formatter;
  14484. data = data.filter(function (d) {
  14485. return typeof d === 'number';
  14486. }).map(function (d) {
  14487. return d.toString();
  14488. });
  14489. if (!formatter) return data;
  14490. var type = (0, _typeof2["default"])(formatter);
  14491. if (type === 'string') return data.map(function (d) {
  14492. return formatter.replace('{value}', d);
  14493. });
  14494. if (type === 'function') return data.map(function (value, index) {
  14495. return formatter({
  14496. value: value,
  14497. index: index
  14498. });
  14499. });
  14500. return data;
  14501. }
  14502. function getLabelStyle(lineItem) {
  14503. var color = lineItem.color,
  14504. style = lineItem.label.style;
  14505. return (0, util$1.deepMerge)({
  14506. fill: color
  14507. }, style);
  14508. }
  14509. });
  14510. unwrapExports(line_1$1);
  14511. var line_2 = line_1$1.line;
  14512. var bar_1$1 = createCommonjsModule(function (module, exports) {
  14513. Object.defineProperty(exports, "__esModule", {
  14514. value: true
  14515. });
  14516. exports.bar = bar;
  14517. var _typeof2 = interopRequireDefault(_typeof_1);
  14518. var _defineProperty2 = interopRequireDefault(defineProperty);
  14519. var _slicedToArray2 = interopRequireDefault(slicedToArray);
  14520. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  14521. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  14522. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  14523. function bar(chart) {
  14524. var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  14525. var xAxis = option.xAxis,
  14526. yAxis = option.yAxis,
  14527. series = option.series;
  14528. var bars = [];
  14529. if (xAxis && yAxis && series) {
  14530. bars = (0, util$1.initNeedSeries)(series, config.barConfig, 'bar');
  14531. bars = setBarAxis(bars, chart);
  14532. bars = setBarPositionData(bars);
  14533. bars = calcBarsPosition(bars);
  14534. }
  14535. (0, updater_class.doUpdate)({
  14536. chart: chart,
  14537. series: bars.slice(-1),
  14538. key: 'backgroundBar',
  14539. getGraphConfig: getBackgroundBarConfig
  14540. });
  14541. bars.reverse();
  14542. (0, updater_class.doUpdate)({
  14543. chart: chart,
  14544. series: bars,
  14545. key: 'bar',
  14546. getGraphConfig: getBarConfig,
  14547. getStartGraphConfig: getStartBarConfig,
  14548. beforeUpdate: beforeUpdateBar
  14549. });
  14550. (0, updater_class.doUpdate)({
  14551. chart: chart,
  14552. series: bars,
  14553. key: 'barLabel',
  14554. getGraphConfig: getLabelConfig
  14555. });
  14556. }
  14557. function setBarAxis(bars, chart) {
  14558. var axisData = chart.axisData;
  14559. bars.forEach(function (bar) {
  14560. var xAxisIndex = bar.xAxisIndex,
  14561. yAxisIndex = bar.yAxisIndex;
  14562. if (typeof xAxisIndex !== 'number') xAxisIndex = 0;
  14563. if (typeof yAxisIndex !== 'number') yAxisIndex = 0;
  14564. var xAxis = axisData.find(function (_ref) {
  14565. var axis = _ref.axis,
  14566. index = _ref.index;
  14567. return "".concat(axis).concat(index) === "x".concat(xAxisIndex);
  14568. });
  14569. var yAxis = axisData.find(function (_ref2) {
  14570. var axis = _ref2.axis,
  14571. index = _ref2.index;
  14572. return "".concat(axis).concat(index) === "y".concat(yAxisIndex);
  14573. });
  14574. var axis = [xAxis, yAxis];
  14575. var valueAxisIndex = axis.findIndex(function (_ref3) {
  14576. var data = _ref3.data;
  14577. return data === 'value';
  14578. });
  14579. bar.valueAxis = axis[valueAxisIndex];
  14580. bar.labelAxis = axis[1 - valueAxisIndex];
  14581. });
  14582. return bars;
  14583. }
  14584. function setBarPositionData(bars, chart) {
  14585. var labelBarGroup = groupBarByLabelAxis(bars);
  14586. labelBarGroup.forEach(function (group) {
  14587. setBarIndex(group);
  14588. setBarNum(group);
  14589. setBarCategoryWidth(group);
  14590. setBarWidthAndGap(group);
  14591. setBarAllWidthAndGap(group);
  14592. });
  14593. return bars;
  14594. }
  14595. function setBarIndex(bars) {
  14596. var stacks = getBarStack(bars);
  14597. stacks = stacks.map(function (stack) {
  14598. return {
  14599. stack: stack,
  14600. index: -1
  14601. };
  14602. });
  14603. var currentIndex = 0;
  14604. bars.forEach(function (bar) {
  14605. var stack = bar.stack;
  14606. if (!stack) {
  14607. bar.barIndex = currentIndex;
  14608. currentIndex++;
  14609. } else {
  14610. var stackData = stacks.find(function (_ref4) {
  14611. var s = _ref4.stack;
  14612. return s === stack;
  14613. });
  14614. if (stackData.index === -1) {
  14615. stackData.index = currentIndex;
  14616. currentIndex++;
  14617. }
  14618. bar.barIndex = stackData.index;
  14619. }
  14620. });
  14621. }
  14622. function groupBarByLabelAxis(bars) {
  14623. var labelAxis = bars.map(function (_ref5) {
  14624. var _ref5$labelAxis = _ref5.labelAxis,
  14625. axis = _ref5$labelAxis.axis,
  14626. index = _ref5$labelAxis.index;
  14627. return axis + index;
  14628. });
  14629. labelAxis = (0, _toConsumableArray2["default"])(new Set(labelAxis));
  14630. return labelAxis.map(function (axisIndex) {
  14631. return bars.filter(function (_ref6) {
  14632. var _ref6$labelAxis = _ref6.labelAxis,
  14633. axis = _ref6$labelAxis.axis,
  14634. index = _ref6$labelAxis.index;
  14635. return axis + index === axisIndex;
  14636. });
  14637. });
  14638. }
  14639. function getBarStack(bars) {
  14640. var stacks = [];
  14641. bars.forEach(function (_ref7) {
  14642. var stack = _ref7.stack;
  14643. if (stack) stacks.push(stack);
  14644. });
  14645. return (0, _toConsumableArray2["default"])(new Set(stacks));
  14646. }
  14647. function setBarNum(bars) {
  14648. var barNum = (0, _toConsumableArray2["default"])(new Set(bars.map(function (_ref8) {
  14649. var barIndex = _ref8.barIndex;
  14650. return barIndex;
  14651. }))).length;
  14652. bars.forEach(function (bar) {
  14653. return bar.barNum = barNum;
  14654. });
  14655. }
  14656. function setBarCategoryWidth(bars) {
  14657. var lastBar = bars.slice(-1)[0];
  14658. var barCategoryGap = lastBar.barCategoryGap,
  14659. tickGap = lastBar.labelAxis.tickGap;
  14660. var barCategoryWidth = 0;
  14661. if (typeof barCategoryGap === 'number') {
  14662. barCategoryWidth = barCategoryGap;
  14663. } else {
  14664. barCategoryWidth = (1 - parseInt(barCategoryGap) / 100) * tickGap;
  14665. }
  14666. bars.forEach(function (bar) {
  14667. return bar.barCategoryWidth = barCategoryWidth;
  14668. });
  14669. }
  14670. function setBarWidthAndGap(bars) {
  14671. var _bars$slice$ = bars.slice(-1)[0],
  14672. barCategoryWidth = _bars$slice$.barCategoryWidth,
  14673. barWidth = _bars$slice$.barWidth,
  14674. barGap = _bars$slice$.barGap,
  14675. barNum = _bars$slice$.barNum;
  14676. var widthAndGap = [];
  14677. if (typeof barWidth === 'number' || barWidth !== 'auto') {
  14678. widthAndGap = getBarWidthAndGapWithPercentOrNumber(barCategoryWidth, barWidth, barGap);
  14679. } else if (barWidth === 'auto') {
  14680. widthAndGap = getBarWidthAndGapWidthAuto(barCategoryWidth, barWidth, barGap, barNum);
  14681. }
  14682. var _widthAndGap = widthAndGap,
  14683. _widthAndGap2 = (0, _slicedToArray2["default"])(_widthAndGap, 2),
  14684. width = _widthAndGap2[0],
  14685. gap = _widthAndGap2[1];
  14686. bars.forEach(function (bar) {
  14687. bar.barWidth = width;
  14688. bar.barGap = gap;
  14689. });
  14690. }
  14691. function getBarWidthAndGapWithPercentOrNumber(barCategoryWidth, barWidth, barGap) {
  14692. var width = 0,
  14693. gap = 0;
  14694. if (typeof barWidth === 'number') {
  14695. width = barWidth;
  14696. } else {
  14697. width = parseInt(barWidth) / 100 * barCategoryWidth;
  14698. }
  14699. if (typeof barGap === 'number') {
  14700. gap = barGap;
  14701. } else {
  14702. gap = parseInt(barGap) / 100 * width;
  14703. }
  14704. return [width, gap];
  14705. }
  14706. function getBarWidthAndGapWidthAuto(barCategoryWidth, barWidth, barGap, barNum) {
  14707. var width = 0,
  14708. gap = 0;
  14709. var barItemWidth = barCategoryWidth / barNum;
  14710. if (typeof barGap === 'number') {
  14711. gap = barGap;
  14712. width = barItemWidth - gap;
  14713. } else {
  14714. var percent = 10 + parseInt(barGap) / 10;
  14715. if (percent === 0) {
  14716. width = barItemWidth * 2;
  14717. gap = -width;
  14718. } else {
  14719. width = barItemWidth / percent * 10;
  14720. gap = barItemWidth - width;
  14721. }
  14722. }
  14723. return [width, gap];
  14724. }
  14725. function setBarAllWidthAndGap(bars) {
  14726. var _bars$slice$2 = bars.slice(-1)[0],
  14727. barGap = _bars$slice$2.barGap,
  14728. barWidth = _bars$slice$2.barWidth,
  14729. barNum = _bars$slice$2.barNum;
  14730. var barAllWidthAndGap = (barGap + barWidth) * barNum - barGap;
  14731. bars.forEach(function (bar) {
  14732. return bar.barAllWidthAndGap = barAllWidthAndGap;
  14733. });
  14734. }
  14735. function calcBarsPosition(bars, chart) {
  14736. bars = calcBarValueAxisCoordinate(bars);
  14737. bars = calcBarLabelAxisCoordinate(bars);
  14738. bars = eliminateNullBarLabelAxis(bars);
  14739. bars = keepSameNumBetweenBarAndData(bars);
  14740. return bars;
  14741. }
  14742. function calcBarLabelAxisCoordinate(bars) {
  14743. return bars.map(function (bar) {
  14744. var labelAxis = bar.labelAxis,
  14745. barAllWidthAndGap = bar.barAllWidthAndGap,
  14746. barGap = bar.barGap,
  14747. barWidth = bar.barWidth,
  14748. barIndex = bar.barIndex;
  14749. var tickGap = labelAxis.tickGap,
  14750. tickPosition = labelAxis.tickPosition,
  14751. axis = labelAxis.axis;
  14752. var coordinateIndex = axis === 'x' ? 0 : 1;
  14753. var barLabelAxisPos = tickPosition.map(function (tick, i) {
  14754. var barCategoryStartPos = tickPosition[i][coordinateIndex] - tickGap / 2;
  14755. var barItemsStartPos = barCategoryStartPos + (tickGap - barAllWidthAndGap) / 2;
  14756. return barItemsStartPos + (barIndex + 0.5) * barWidth + barIndex * barGap;
  14757. });
  14758. return _objectSpread({}, bar, {
  14759. barLabelAxisPos: barLabelAxisPos
  14760. });
  14761. });
  14762. }
  14763. function calcBarValueAxisCoordinate(bars) {
  14764. return bars.map(function (bar) {
  14765. var data = (0, util$1.mergeSameStackData)(bar, bars);
  14766. data = eliminateNonNumberData(bar, data);
  14767. var _bar$valueAxis = bar.valueAxis,
  14768. axis = _bar$valueAxis.axis,
  14769. minValue = _bar$valueAxis.minValue,
  14770. maxValue = _bar$valueAxis.maxValue,
  14771. linePosition = _bar$valueAxis.linePosition;
  14772. var startPos = getValuePos(minValue, maxValue, minValue < 0 ? 0 : minValue, linePosition, axis);
  14773. var endPos = data.map(function (v) {
  14774. return getValuePos(minValue, maxValue, v, linePosition, axis);
  14775. });
  14776. var barValueAxisPos = endPos.map(function (p) {
  14777. return [startPos, p];
  14778. });
  14779. return _objectSpread({}, bar, {
  14780. barValueAxisPos: barValueAxisPos
  14781. });
  14782. });
  14783. }
  14784. function eliminateNonNumberData(barItem, barData) {
  14785. var data = barItem.data;
  14786. return barData.map(function (v, i) {
  14787. return typeof data[i] === 'number' ? v : null;
  14788. }).filter(function (d) {
  14789. return d !== null;
  14790. });
  14791. }
  14792. function eliminateNullBarLabelAxis(bars) {
  14793. return bars.map(function (bar) {
  14794. var barLabelAxisPos = bar.barLabelAxisPos,
  14795. data = bar.data;
  14796. data.forEach(function (d, i) {
  14797. if (typeof d === 'number') return;
  14798. barLabelAxisPos[i] = null;
  14799. });
  14800. return _objectSpread({}, bar, {
  14801. barLabelAxisPos: barLabelAxisPos.filter(function (p) {
  14802. return p !== null;
  14803. })
  14804. });
  14805. });
  14806. }
  14807. function keepSameNumBetweenBarAndData(bars) {
  14808. bars.forEach(function (bar) {
  14809. var data = bar.data,
  14810. barLabelAxisPos = bar.barLabelAxisPos,
  14811. barValueAxisPos = bar.barValueAxisPos;
  14812. var dataNum = data.filter(function (d) {
  14813. return typeof d === 'number';
  14814. }).length;
  14815. var axisPosNum = barLabelAxisPos.length;
  14816. if (axisPosNum > dataNum) {
  14817. barLabelAxisPos.splice(dataNum);
  14818. barValueAxisPos.splice(dataNum);
  14819. }
  14820. });
  14821. return bars;
  14822. }
  14823. function getValuePos(min, max, value, linePosition, axis) {
  14824. if (typeof value !== 'number') return null;
  14825. var valueMinus = max - min;
  14826. var coordinateIndex = axis === 'x' ? 0 : 1;
  14827. var posMinus = linePosition[1][coordinateIndex] - linePosition[0][coordinateIndex];
  14828. var percent = (value - min) / valueMinus;
  14829. if (valueMinus === 0) percent = 0;
  14830. var pos = percent * posMinus;
  14831. return pos + linePosition[0][coordinateIndex];
  14832. }
  14833. function getBackgroundBarConfig(barItem) {
  14834. var animationCurve = barItem.animationCurve,
  14835. animationFrame = barItem.animationFrame,
  14836. rLevel = barItem.rLevel;
  14837. var shapes = getBackgroundBarShapes(barItem);
  14838. var style = getBackgroundBarStyle(barItem);
  14839. return shapes.map(function (shape) {
  14840. return {
  14841. name: 'rect',
  14842. index: rLevel,
  14843. visible: barItem.backgroundBar.show,
  14844. animationCurve: animationCurve,
  14845. animationFrame: animationFrame,
  14846. shape: shape,
  14847. style: style
  14848. };
  14849. });
  14850. }
  14851. function getBackgroundBarShapes(barItem) {
  14852. var labelAxis = barItem.labelAxis,
  14853. valueAxis = barItem.valueAxis;
  14854. var tickPosition = labelAxis.tickPosition;
  14855. var axis = valueAxis.axis,
  14856. linePosition = valueAxis.linePosition;
  14857. var width = getBackgroundBarWidth(barItem);
  14858. var haltWidth = width / 2;
  14859. var posIndex = axis === 'x' ? 0 : 1;
  14860. var centerPos = tickPosition.map(function (p) {
  14861. return p[1 - posIndex];
  14862. });
  14863. var _ref9 = [linePosition[0][posIndex], linePosition[1][posIndex]],
  14864. start = _ref9[0],
  14865. end = _ref9[1];
  14866. return centerPos.map(function (center) {
  14867. if (axis === 'x') {
  14868. return {
  14869. x: start,
  14870. y: center - haltWidth,
  14871. w: end - start,
  14872. h: width
  14873. };
  14874. } else {
  14875. return {
  14876. x: center - haltWidth,
  14877. y: end,
  14878. w: width,
  14879. h: start - end
  14880. };
  14881. }
  14882. });
  14883. }
  14884. function getBackgroundBarWidth(barItem) {
  14885. var barAllWidthAndGap = barItem.barAllWidthAndGap,
  14886. barCategoryWidth = barItem.barCategoryWidth,
  14887. backgroundBar = barItem.backgroundBar;
  14888. var width = backgroundBar.width;
  14889. if (typeof width === 'number') return width;
  14890. if (width === 'auto') return barAllWidthAndGap;
  14891. return parseInt(width) / 100 * barCategoryWidth;
  14892. }
  14893. function getBackgroundBarStyle(barItem) {
  14894. return barItem.backgroundBar.style;
  14895. }
  14896. function getBarConfig(barItem) {
  14897. var barLabelAxisPos = barItem.barLabelAxisPos,
  14898. animationCurve = barItem.animationCurve,
  14899. animationFrame = barItem.animationFrame,
  14900. rLevel = barItem.rLevel;
  14901. var name = getBarName(barItem);
  14902. return barLabelAxisPos.map(function (foo, i) {
  14903. return {
  14904. name: name,
  14905. index: rLevel,
  14906. animationCurve: animationCurve,
  14907. animationFrame: animationFrame,
  14908. shape: getBarShape(barItem, i),
  14909. style: getBarStyle(barItem, i)
  14910. };
  14911. });
  14912. }
  14913. function getBarName(barItem) {
  14914. var shapeType = barItem.shapeType;
  14915. if (shapeType === 'leftEchelon' || shapeType === 'rightEchelon') return 'polyline';
  14916. return 'rect';
  14917. }
  14918. function getBarShape(barItem, i) {
  14919. var shapeType = barItem.shapeType;
  14920. if (shapeType === 'leftEchelon') {
  14921. return getLeftEchelonShape(barItem, i);
  14922. } else if (shapeType === 'rightEchelon') {
  14923. return getRightEchelonShape(barItem, i);
  14924. } else {
  14925. return getNormalBarShape(barItem, i);
  14926. }
  14927. }
  14928. function getLeftEchelonShape(barItem, i) {
  14929. var barValueAxisPos = barItem.barValueAxisPos,
  14930. barLabelAxisPos = barItem.barLabelAxisPos,
  14931. barWidth = barItem.barWidth,
  14932. echelonOffset = barItem.echelonOffset;
  14933. var _barValueAxisPos$i = (0, _slicedToArray2["default"])(barValueAxisPos[i], 2),
  14934. start = _barValueAxisPos$i[0],
  14935. end = _barValueAxisPos$i[1];
  14936. var labelAxisPos = barLabelAxisPos[i];
  14937. var halfWidth = barWidth / 2;
  14938. var valueAxis = barItem.valueAxis.axis;
  14939. var points = [];
  14940. if (valueAxis === 'x') {
  14941. points[0] = [end, labelAxisPos - halfWidth];
  14942. points[1] = [end, labelAxisPos + halfWidth];
  14943. points[2] = [start, labelAxisPos + halfWidth];
  14944. points[3] = [start + echelonOffset, labelAxisPos - halfWidth];
  14945. if (end - start < echelonOffset) points.splice(3, 1);
  14946. } else {
  14947. points[0] = [labelAxisPos - halfWidth, end];
  14948. points[1] = [labelAxisPos + halfWidth, end];
  14949. points[2] = [labelAxisPos + halfWidth, start];
  14950. points[3] = [labelAxisPos - halfWidth, start - echelonOffset];
  14951. if (start - end < echelonOffset) points.splice(3, 1);
  14952. }
  14953. return {
  14954. points: points,
  14955. close: true
  14956. };
  14957. }
  14958. function getRightEchelonShape(barItem, i) {
  14959. var barValueAxisPos = barItem.barValueAxisPos,
  14960. barLabelAxisPos = barItem.barLabelAxisPos,
  14961. barWidth = barItem.barWidth,
  14962. echelonOffset = barItem.echelonOffset;
  14963. var _barValueAxisPos$i2 = (0, _slicedToArray2["default"])(barValueAxisPos[i], 2),
  14964. start = _barValueAxisPos$i2[0],
  14965. end = _barValueAxisPos$i2[1];
  14966. var labelAxisPos = barLabelAxisPos[i];
  14967. var halfWidth = barWidth / 2;
  14968. var valueAxis = barItem.valueAxis.axis;
  14969. var points = [];
  14970. if (valueAxis === 'x') {
  14971. points[0] = [end, labelAxisPos + halfWidth];
  14972. points[1] = [end, labelAxisPos - halfWidth];
  14973. points[2] = [start, labelAxisPos - halfWidth];
  14974. points[3] = [start + echelonOffset, labelAxisPos + halfWidth];
  14975. if (end - start < echelonOffset) points.splice(2, 1);
  14976. } else {
  14977. points[0] = [labelAxisPos + halfWidth, end];
  14978. points[1] = [labelAxisPos - halfWidth, end];
  14979. points[2] = [labelAxisPos - halfWidth, start];
  14980. points[3] = [labelAxisPos + halfWidth, start - echelonOffset];
  14981. if (start - end < echelonOffset) points.splice(2, 1);
  14982. }
  14983. return {
  14984. points: points,
  14985. close: true
  14986. };
  14987. }
  14988. function getNormalBarShape(barItem, i) {
  14989. var barValueAxisPos = barItem.barValueAxisPos,
  14990. barLabelAxisPos = barItem.barLabelAxisPos,
  14991. barWidth = barItem.barWidth;
  14992. var _barValueAxisPos$i3 = (0, _slicedToArray2["default"])(barValueAxisPos[i], 2),
  14993. start = _barValueAxisPos$i3[0],
  14994. end = _barValueAxisPos$i3[1];
  14995. var labelAxisPos = barLabelAxisPos[i];
  14996. var valueAxis = barItem.valueAxis.axis;
  14997. var shape = {};
  14998. if (valueAxis === 'x') {
  14999. shape.x = start;
  15000. shape.y = labelAxisPos - barWidth / 2;
  15001. shape.w = end - start;
  15002. shape.h = barWidth;
  15003. } else {
  15004. shape.x = labelAxisPos - barWidth / 2;
  15005. shape.y = end;
  15006. shape.w = barWidth;
  15007. shape.h = start - end;
  15008. }
  15009. return shape;
  15010. }
  15011. function getBarStyle(barItem, i) {
  15012. var barStyle = barItem.barStyle,
  15013. gradient = barItem.gradient,
  15014. color = barItem.color,
  15015. independentColor = barItem.independentColor,
  15016. independentColors = barItem.independentColors;
  15017. var fillColor = [barStyle.fill || color];
  15018. var gradientColor = (0, util$1.deepMerge)(fillColor, gradient.color);
  15019. if (independentColor) {
  15020. var idtColor = independentColors[i % independentColors.length];
  15021. gradientColor = idtColor instanceof Array ? idtColor : [idtColor];
  15022. }
  15023. if (gradientColor.length === 1) gradientColor.push(gradientColor[0]);
  15024. var gradientParams = getGradientParams(barItem, i);
  15025. return (0, util$1.deepMerge)({
  15026. gradientColor: gradientColor,
  15027. gradientParams: gradientParams,
  15028. gradientType: 'linear',
  15029. gradientWith: 'fill'
  15030. }, barStyle);
  15031. }
  15032. function getGradientParams(barItem, i) {
  15033. var barValueAxisPos = barItem.barValueAxisPos,
  15034. barLabelAxisPos = barItem.barLabelAxisPos,
  15035. data = barItem.data;
  15036. var _barItem$valueAxis = barItem.valueAxis,
  15037. linePosition = _barItem$valueAxis.linePosition,
  15038. axis = _barItem$valueAxis.axis;
  15039. var _barValueAxisPos$i4 = (0, _slicedToArray2["default"])(barValueAxisPos[i], 2),
  15040. start = _barValueAxisPos$i4[0],
  15041. end = _barValueAxisPos$i4[1];
  15042. var labelAxisPos = barLabelAxisPos[i];
  15043. var value = data[i];
  15044. var _linePosition = (0, _slicedToArray2["default"])(linePosition, 2),
  15045. lineStart = _linePosition[0],
  15046. lineEnd = _linePosition[1];
  15047. var valueAxisIndex = axis === 'x' ? 0 : 1;
  15048. var endPos = end;
  15049. if (!barItem.gradient.local) {
  15050. endPos = value < 0 ? lineStart[valueAxisIndex] : lineEnd[valueAxisIndex];
  15051. }
  15052. if (axis === 'y') {
  15053. return [labelAxisPos, endPos, labelAxisPos, start];
  15054. } else {
  15055. return [endPos, labelAxisPos, start, labelAxisPos];
  15056. }
  15057. }
  15058. function getStartBarConfig(barItem) {
  15059. var configs = getBarConfig(barItem);
  15060. var shapeType = barItem.shapeType;
  15061. configs.forEach(function (config) {
  15062. var shape = config.shape;
  15063. if (shapeType === 'leftEchelon') {
  15064. shape = getStartLeftEchelonShape(shape, barItem);
  15065. } else if (shapeType === 'rightEchelon') {
  15066. shape = getStartRightEchelonShape(shape, barItem);
  15067. } else {
  15068. shape = getStartNormalBarShape(shape, barItem);
  15069. }
  15070. config.shape = shape;
  15071. });
  15072. return configs;
  15073. }
  15074. function getStartLeftEchelonShape(shape, barItem) {
  15075. var axis = barItem.valueAxis.axis;
  15076. shape = (0, util.deepClone)(shape);
  15077. var _shape = shape,
  15078. points = _shape.points;
  15079. var index = axis === 'x' ? 0 : 1;
  15080. var start = points[2][index];
  15081. points.forEach(function (point) {
  15082. return point[index] = start;
  15083. });
  15084. return shape;
  15085. }
  15086. function getStartRightEchelonShape(shape, barItem) {
  15087. var axis = barItem.valueAxis.axis;
  15088. shape = (0, util.deepClone)(shape);
  15089. var _shape2 = shape,
  15090. points = _shape2.points;
  15091. var index = axis === 'x' ? 0 : 1;
  15092. var start = points[2][index];
  15093. points.forEach(function (point) {
  15094. return point[index] = start;
  15095. });
  15096. return shape;
  15097. }
  15098. function getStartNormalBarShape(shape, barItem) {
  15099. var axis = barItem.valueAxis.axis;
  15100. var x = shape.x,
  15101. y = shape.y,
  15102. w = shape.w,
  15103. h = shape.h;
  15104. if (axis === 'x') {
  15105. w = 0;
  15106. } else {
  15107. y = y + h;
  15108. h = 0;
  15109. }
  15110. return {
  15111. x: x,
  15112. y: y,
  15113. w: w,
  15114. h: h
  15115. };
  15116. }
  15117. function beforeUpdateBar(graphs, barItem, i, updater) {
  15118. var render = updater.chart.render;
  15119. var name = getBarName(barItem);
  15120. if (graphs[i] && graphs[i][0].name !== name) {
  15121. graphs[i].forEach(function (g) {
  15122. return render.delGraph(g);
  15123. });
  15124. graphs[i] = null;
  15125. }
  15126. }
  15127. function getLabelConfig(barItem) {
  15128. var animationCurve = barItem.animationCurve,
  15129. animationFrame = barItem.animationFrame,
  15130. rLevel = barItem.rLevel;
  15131. var shapes = getLabelShapes(barItem);
  15132. var style = getLabelStyle(barItem);
  15133. return shapes.map(function (shape) {
  15134. return {
  15135. name: 'text',
  15136. index: rLevel,
  15137. visible: barItem.label.show,
  15138. animationCurve: animationCurve,
  15139. animationFrame: animationFrame,
  15140. shape: shape,
  15141. style: style
  15142. };
  15143. });
  15144. }
  15145. function getLabelShapes(barItem) {
  15146. var contents = getFormatterLabels(barItem);
  15147. var position = getLabelsPosition(barItem);
  15148. return position.map(function (pos, i) {
  15149. return {
  15150. position: pos,
  15151. content: contents[i]
  15152. };
  15153. });
  15154. }
  15155. function getFormatterLabels(barItem) {
  15156. var data = barItem.data,
  15157. label = barItem.label;
  15158. var formatter = label.formatter;
  15159. data = data.filter(function (d) {
  15160. return typeof d === 'number';
  15161. }).map(function (d) {
  15162. return d.toString();
  15163. });
  15164. if (!formatter) return data;
  15165. var type = (0, _typeof2["default"])(formatter);
  15166. if (type === 'string') return data.map(function (d) {
  15167. return formatter.replace('{value}', d);
  15168. });
  15169. if (type === 'function') return data.map(function (d, i) {
  15170. return formatter({
  15171. value: d,
  15172. index: i
  15173. });
  15174. });
  15175. return data;
  15176. }
  15177. function getLabelsPosition(barItem) {
  15178. var label = barItem.label,
  15179. barValueAxisPos = barItem.barValueAxisPos,
  15180. barLabelAxisPos = barItem.barLabelAxisPos;
  15181. var position = label.position,
  15182. offset = label.offset;
  15183. var axis = barItem.valueAxis.axis;
  15184. return barValueAxisPos.map(function (_ref10, i) {
  15185. var _ref11 = (0, _slicedToArray2["default"])(_ref10, 2),
  15186. start = _ref11[0],
  15187. end = _ref11[1];
  15188. var labelAxisPos = barLabelAxisPos[i];
  15189. var pos = [end, labelAxisPos];
  15190. if (position === 'bottom') {
  15191. pos = [start, labelAxisPos];
  15192. }
  15193. if (position === 'center') {
  15194. pos = [(start + end) / 2, labelAxisPos];
  15195. }
  15196. if (axis === 'y') pos.reverse();
  15197. return getOffsetedPoint(pos, offset);
  15198. });
  15199. }
  15200. function getOffsetedPoint(_ref12, _ref13) {
  15201. var _ref14 = (0, _slicedToArray2["default"])(_ref12, 2),
  15202. x = _ref14[0],
  15203. y = _ref14[1];
  15204. var _ref15 = (0, _slicedToArray2["default"])(_ref13, 2),
  15205. ox = _ref15[0],
  15206. oy = _ref15[1];
  15207. return [x + ox, y + oy];
  15208. }
  15209. function getLabelStyle(barItem) {
  15210. var color = barItem.color,
  15211. style = barItem.label.style,
  15212. gc = barItem.gradient.color;
  15213. if (gc.length) color = gc[0];
  15214. style = (0, util$1.deepMerge)({
  15215. fill: color
  15216. }, style);
  15217. return style;
  15218. }
  15219. });
  15220. unwrapExports(bar_1$1);
  15221. var bar_2 = bar_1$1.bar;
  15222. var pie_1$1 = createCommonjsModule(function (module, exports) {
  15223. Object.defineProperty(exports, "__esModule", {
  15224. value: true
  15225. });
  15226. exports.pie = pie;
  15227. var _defineProperty2 = interopRequireDefault(defineProperty);
  15228. var _typeof2 = interopRequireDefault(_typeof_1);
  15229. var _slicedToArray2 = interopRequireDefault(slicedToArray);
  15230. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  15231. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  15232. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  15233. function pie(chart) {
  15234. var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15235. var series = option.series;
  15236. if (!series) series = [];
  15237. var pies = (0, util$1.initNeedSeries)(series, pie$1.pieConfig, 'pie');
  15238. pies = calcPiesCenter(pies, chart);
  15239. pies = calcPiesRadius(pies, chart);
  15240. pies = calcRosePiesRadius(pies);
  15241. pies = calcPiesPercent(pies);
  15242. pies = calcPiesAngle(pies);
  15243. pies = calcPiesInsideLabelPos(pies);
  15244. pies = calcPiesEdgeCenterPos(pies);
  15245. pies = calcPiesOutSideLabelPos(pies);
  15246. (0, updater_class.doUpdate)({
  15247. chart: chart,
  15248. series: pies,
  15249. key: 'pie',
  15250. getGraphConfig: getPieConfig,
  15251. getStartGraphConfig: getStartPieConfig,
  15252. beforeChange: beforeChangePie
  15253. });
  15254. (0, updater_class.doUpdate)({
  15255. chart: chart,
  15256. series: pies,
  15257. key: 'pieInsideLabel',
  15258. getGraphConfig: getInsideLabelConfig
  15259. });
  15260. (0, updater_class.doUpdate)({
  15261. chart: chart,
  15262. series: pies,
  15263. key: 'pieOutsideLabelLine',
  15264. getGraphConfig: getOutsideLabelLineConfig,
  15265. getStartGraphConfig: getStartOutsideLabelLineConfig
  15266. });
  15267. (0, updater_class.doUpdate)({
  15268. chart: chart,
  15269. series: pies,
  15270. key: 'pieOutsideLabel',
  15271. getGraphConfig: getOutsideLabelConfig,
  15272. getStartGraphConfig: getStartOutsideLabelConfig
  15273. });
  15274. }
  15275. function calcPiesCenter(pies, chart) {
  15276. var area = chart.render.area;
  15277. pies.forEach(function (pie) {
  15278. var center = pie.center;
  15279. center = center.map(function (pos, i) {
  15280. if (typeof pos === 'number') return pos;
  15281. return parseInt(pos) / 100 * area[i];
  15282. });
  15283. pie.center = center;
  15284. });
  15285. return pies;
  15286. }
  15287. function calcPiesRadius(pies, chart) {
  15288. var maxRadius = Math.min.apply(Math, (0, _toConsumableArray2["default"])(chart.render.area)) / 2;
  15289. pies.forEach(function (pie) {
  15290. var radius = pie.radius,
  15291. data = pie.data;
  15292. radius = getNumberRadius(radius, maxRadius);
  15293. data.forEach(function (item) {
  15294. var itemRadius = item.radius;
  15295. if (!itemRadius) itemRadius = radius;
  15296. itemRadius = getNumberRadius(itemRadius, maxRadius);
  15297. item.radius = itemRadius;
  15298. });
  15299. pie.radius = radius;
  15300. });
  15301. return pies;
  15302. }
  15303. function getNumberRadius(radius, maxRadius) {
  15304. if (!(radius instanceof Array)) radius = [0, radius];
  15305. radius = radius.map(function (r) {
  15306. if (typeof r === 'number') return r;
  15307. return parseInt(r) / 100 * maxRadius;
  15308. });
  15309. return radius;
  15310. }
  15311. function calcRosePiesRadius(pies, chart) {
  15312. var rosePie = pies.filter(function (_ref) {
  15313. var roseType = _ref.roseType;
  15314. return roseType;
  15315. });
  15316. rosePie.forEach(function (pie) {
  15317. var radius = pie.radius,
  15318. data = pie.data,
  15319. roseSort = pie.roseSort;
  15320. var roseIncrement = getRoseIncrement(pie);
  15321. var dataCopy = (0, _toConsumableArray2["default"])(data);
  15322. data = sortData(data);
  15323. data.forEach(function (item, i) {
  15324. item.radius[1] = radius[1] - roseIncrement * i;
  15325. });
  15326. if (roseSort) {
  15327. data.reverse();
  15328. } else {
  15329. pie.data = dataCopy;
  15330. }
  15331. pie.roseIncrement = roseIncrement;
  15332. });
  15333. return pies;
  15334. }
  15335. function sortData(data) {
  15336. return data.sort(function (_ref2, _ref3) {
  15337. var a = _ref2.value;
  15338. var b = _ref3.value;
  15339. if (a === b) return 0;
  15340. if (a > b) return -1;
  15341. if (a < b) return 1;
  15342. });
  15343. }
  15344. function getRoseIncrement(pie) {
  15345. var radius = pie.radius,
  15346. roseIncrement = pie.roseIncrement;
  15347. if (typeof roseIncrement === 'number') return roseIncrement;
  15348. if (roseIncrement === 'auto') {
  15349. var data = pie.data;
  15350. var allRadius = data.reduce(function (all, _ref4) {
  15351. var radius = _ref4.radius;
  15352. return [].concat((0, _toConsumableArray2["default"])(all), (0, _toConsumableArray2["default"])(radius));
  15353. }, []);
  15354. var minRadius = Math.min.apply(Math, (0, _toConsumableArray2["default"])(allRadius));
  15355. var maxRadius = Math.max.apply(Math, (0, _toConsumableArray2["default"])(allRadius));
  15356. return (maxRadius - minRadius) * 0.6 / (data.length - 1 || 1);
  15357. }
  15358. return parseInt(roseIncrement) / 100 * radius[1];
  15359. }
  15360. function calcPiesPercent(pies) {
  15361. pies.forEach(function (pie) {
  15362. var data = pie.data,
  15363. percentToFixed = pie.percentToFixed;
  15364. var sum = getDataSum(data);
  15365. data.forEach(function (item) {
  15366. var value = item.value;
  15367. item.percent = value / sum * 100;
  15368. item.percentForLabel = toFixedNoCeil(value / sum * 100, percentToFixed);
  15369. });
  15370. var percentSumNoLast = (0, util$1.mulAdd)(data.slice(0, -1).map(function (_ref5) {
  15371. var percent = _ref5.percent;
  15372. return percent;
  15373. }));
  15374. data.slice(-1)[0].percent = 100 - percentSumNoLast;
  15375. data.slice(-1)[0].percentForLabel = toFixedNoCeil(100 - percentSumNoLast, percentToFixed);
  15376. });
  15377. return pies;
  15378. }
  15379. function toFixedNoCeil(number) {
  15380. var toFixed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  15381. var stringNumber = number.toString();
  15382. var splitedNumber = stringNumber.split('.');
  15383. var decimal = splitedNumber[1] || '0';
  15384. var fixedDecimal = decimal.slice(0, toFixed);
  15385. splitedNumber[1] = fixedDecimal;
  15386. return parseFloat(splitedNumber.join('.'));
  15387. }
  15388. function getDataSum(data) {
  15389. return (0, util$1.mulAdd)(data.map(function (_ref6) {
  15390. var value = _ref6.value;
  15391. return value;
  15392. }));
  15393. }
  15394. function calcPiesAngle(pies) {
  15395. pies.forEach(function (pie) {
  15396. var start = pie.startAngle,
  15397. data = pie.data;
  15398. data.forEach(function (item, i) {
  15399. var _getDataAngle = getDataAngle(data, i),
  15400. _getDataAngle2 = (0, _slicedToArray2["default"])(_getDataAngle, 2),
  15401. startAngle = _getDataAngle2[0],
  15402. endAngle = _getDataAngle2[1];
  15403. item.startAngle = start + startAngle;
  15404. item.endAngle = start + endAngle;
  15405. });
  15406. });
  15407. return pies;
  15408. }
  15409. function getDataAngle(data, i) {
  15410. var fullAngle = Math.PI * 2;
  15411. var needAddData = data.slice(0, i + 1);
  15412. var percentSum = (0, util$1.mulAdd)(needAddData.map(function (_ref7) {
  15413. var percent = _ref7.percent;
  15414. return percent;
  15415. }));
  15416. var percent = data[i].percent;
  15417. var startPercent = percentSum - percent;
  15418. return [fullAngle * startPercent / 100, fullAngle * percentSum / 100];
  15419. }
  15420. function calcPiesInsideLabelPos(pies) {
  15421. pies.forEach(function (pieItem) {
  15422. var data = pieItem.data;
  15423. data.forEach(function (item) {
  15424. item.insideLabelPos = getPieInsideLabelPos(pieItem, item);
  15425. });
  15426. });
  15427. return pies;
  15428. }
  15429. function getPieInsideLabelPos(pieItem, dataItem) {
  15430. var center = pieItem.center;
  15431. var startAngle = dataItem.startAngle,
  15432. endAngle = dataItem.endAngle,
  15433. _dataItem$radius = (0, _slicedToArray2["default"])(dataItem.radius, 2),
  15434. ir = _dataItem$radius[0],
  15435. or = _dataItem$radius[1];
  15436. var radius = (ir + or) / 2;
  15437. var angle = (startAngle + endAngle) / 2;
  15438. return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([radius, angle]));
  15439. }
  15440. function calcPiesEdgeCenterPos(pies) {
  15441. pies.forEach(function (pie) {
  15442. var data = pie.data,
  15443. center = pie.center;
  15444. data.forEach(function (item) {
  15445. var startAngle = item.startAngle,
  15446. endAngle = item.endAngle,
  15447. radius = item.radius;
  15448. var centerAngle = (startAngle + endAngle) / 2;
  15449. var pos = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([radius[1], centerAngle]));
  15450. item.edgeCenterPos = pos;
  15451. });
  15452. });
  15453. return pies;
  15454. }
  15455. function calcPiesOutSideLabelPos(pies) {
  15456. pies.forEach(function (pieItem) {
  15457. var leftPieDataItems = getLeftOrRightPieDataItems(pieItem);
  15458. var rightPieDataItems = getLeftOrRightPieDataItems(pieItem, false);
  15459. leftPieDataItems = sortPiesFromTopToBottom(leftPieDataItems);
  15460. rightPieDataItems = sortPiesFromTopToBottom(rightPieDataItems);
  15461. addLabelLineAndAlign(leftPieDataItems, pieItem);
  15462. addLabelLineAndAlign(rightPieDataItems, pieItem, false);
  15463. });
  15464. return pies;
  15465. }
  15466. function getLabelLineBendRadius(pieItem) {
  15467. var labelLineBendGap = pieItem.outsideLabel.labelLineBendGap;
  15468. var maxRadius = getPieMaxRadius(pieItem);
  15469. if (typeof labelLineBendGap !== 'number') {
  15470. labelLineBendGap = parseInt(labelLineBendGap) / 100 * maxRadius;
  15471. }
  15472. return labelLineBendGap + maxRadius;
  15473. }
  15474. function getPieMaxRadius(pieItem) {
  15475. var data = pieItem.data;
  15476. var radius = data.map(function (_ref8) {
  15477. var _ref8$radius = (0, _slicedToArray2["default"])(_ref8.radius, 2),
  15478. foo = _ref8$radius[0],
  15479. r = _ref8$radius[1];
  15480. return r;
  15481. });
  15482. return Math.max.apply(Math, (0, _toConsumableArray2["default"])(radius));
  15483. }
  15484. function getLeftOrRightPieDataItems(pieItem) {
  15485. var left = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  15486. var data = pieItem.data,
  15487. center = pieItem.center;
  15488. var centerXPos = center[0];
  15489. return data.filter(function (_ref9) {
  15490. var edgeCenterPos = _ref9.edgeCenterPos;
  15491. var xPos = edgeCenterPos[0];
  15492. if (left) return xPos <= centerXPos;
  15493. return xPos > centerXPos;
  15494. });
  15495. }
  15496. function sortPiesFromTopToBottom(dataItem) {
  15497. dataItem.sort(function (_ref10, _ref11) {
  15498. var _ref10$edgeCenterPos = (0, _slicedToArray2["default"])(_ref10.edgeCenterPos, 2),
  15499. t = _ref10$edgeCenterPos[0],
  15500. ay = _ref10$edgeCenterPos[1];
  15501. var _ref11$edgeCenterPos = (0, _slicedToArray2["default"])(_ref11.edgeCenterPos, 2),
  15502. tt = _ref11$edgeCenterPos[0],
  15503. by = _ref11$edgeCenterPos[1];
  15504. if (ay > by) return 1;
  15505. if (ay < by) return -1;
  15506. if (ay === by) return 0;
  15507. });
  15508. return dataItem;
  15509. }
  15510. function addLabelLineAndAlign(dataItem, pieItem) {
  15511. var left = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  15512. var center = pieItem.center,
  15513. outsideLabel = pieItem.outsideLabel;
  15514. var radius = getLabelLineBendRadius(pieItem);
  15515. dataItem.forEach(function (item) {
  15516. var edgeCenterPos = item.edgeCenterPos,
  15517. startAngle = item.startAngle,
  15518. endAngle = item.endAngle;
  15519. var labelLineEndLength = outsideLabel.labelLineEndLength;
  15520. var angle = (startAngle + endAngle) / 2;
  15521. var bendPoint = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([radius, angle]));
  15522. var endPoint = (0, _toConsumableArray2["default"])(bendPoint);
  15523. endPoint[0] += labelLineEndLength * (left ? -1 : 1);
  15524. item.labelLine = [edgeCenterPos, bendPoint, endPoint];
  15525. item.labelLineLength = (0, util$1.getPolylineLength)(item.labelLine);
  15526. item.align = {
  15527. textAlign: 'left',
  15528. textBaseline: 'middle'
  15529. };
  15530. if (left) item.align.textAlign = 'right';
  15531. });
  15532. }
  15533. function getPieConfig(pieItem) {
  15534. var data = pieItem.data,
  15535. animationCurve = pieItem.animationCurve,
  15536. animationFrame = pieItem.animationFrame,
  15537. rLevel = pieItem.rLevel;
  15538. return data.map(function (foo, i) {
  15539. return {
  15540. name: 'pie',
  15541. index: rLevel,
  15542. animationCurve: animationCurve,
  15543. animationFrame: animationFrame,
  15544. shape: getPieShape(pieItem, i),
  15545. style: getPieStyle(pieItem, i)
  15546. };
  15547. });
  15548. }
  15549. function getStartPieConfig(pieItem) {
  15550. var animationDelayGap = pieItem.animationDelayGap,
  15551. startAnimationCurve = pieItem.startAnimationCurve;
  15552. var configs = getPieConfig(pieItem);
  15553. configs.forEach(function (config, i) {
  15554. config.animationCurve = startAnimationCurve;
  15555. config.animationDelay = i * animationDelayGap;
  15556. config.shape.or = config.shape.ir;
  15557. });
  15558. return configs;
  15559. }
  15560. function beforeChangePie(graph) {
  15561. graph.animationDelay = 0;
  15562. }
  15563. function getPieShape(pieItem, i) {
  15564. var center = pieItem.center,
  15565. data = pieItem.data;
  15566. var dataItem = data[i];
  15567. var radius = dataItem.radius,
  15568. startAngle = dataItem.startAngle,
  15569. endAngle = dataItem.endAngle;
  15570. return {
  15571. startAngle: startAngle,
  15572. endAngle: endAngle,
  15573. ir: radius[0],
  15574. or: radius[1],
  15575. rx: center[0],
  15576. ry: center[1]
  15577. };
  15578. }
  15579. function getPieStyle(pieItem, i) {
  15580. var pieStyle = pieItem.pieStyle,
  15581. data = pieItem.data;
  15582. var dataItem = data[i];
  15583. var color = dataItem.color;
  15584. return (0, util$1.deepMerge)({
  15585. fill: color
  15586. }, pieStyle);
  15587. }
  15588. function getInsideLabelConfig(pieItem) {
  15589. var animationCurve = pieItem.animationCurve,
  15590. animationFrame = pieItem.animationFrame,
  15591. data = pieItem.data,
  15592. rLevel = pieItem.rLevel;
  15593. return data.map(function (foo, i) {
  15594. return {
  15595. name: 'text',
  15596. index: rLevel,
  15597. visible: pieItem.insideLabel.show,
  15598. animationCurve: animationCurve,
  15599. animationFrame: animationFrame,
  15600. shape: getInsideLabelShape(pieItem, i),
  15601. style: getInsideLabelStyle(pieItem)
  15602. };
  15603. });
  15604. }
  15605. function getInsideLabelShape(pieItem, i) {
  15606. var insideLabel = pieItem.insideLabel,
  15607. data = pieItem.data;
  15608. var formatter = insideLabel.formatter;
  15609. var dataItem = data[i];
  15610. var formatterType = (0, _typeof2["default"])(formatter);
  15611. var label = '';
  15612. if (formatterType === 'string') {
  15613. label = formatter.replace('{name}', dataItem.name);
  15614. label = label.replace('{percent}', dataItem.percentForLabel);
  15615. label = label.replace('{value}', dataItem.value);
  15616. }
  15617. if (formatterType === 'function') {
  15618. label = formatter(dataItem);
  15619. }
  15620. return {
  15621. content: label,
  15622. position: dataItem.insideLabelPos
  15623. };
  15624. }
  15625. function getInsideLabelStyle(pieItem, i) {
  15626. var style = pieItem.insideLabel.style;
  15627. return style;
  15628. }
  15629. function getOutsideLabelLineConfig(pieItem) {
  15630. var animationCurve = pieItem.animationCurve,
  15631. animationFrame = pieItem.animationFrame,
  15632. data = pieItem.data,
  15633. rLevel = pieItem.rLevel;
  15634. return data.map(function (foo, i) {
  15635. return {
  15636. name: 'polyline',
  15637. index: rLevel,
  15638. visible: pieItem.outsideLabel.show,
  15639. animationCurve: animationCurve,
  15640. animationFrame: animationFrame,
  15641. shape: getOutsideLabelLineShape(pieItem, i),
  15642. style: getOutsideLabelLineStyle(pieItem, i)
  15643. };
  15644. });
  15645. }
  15646. function getStartOutsideLabelLineConfig(pieItem) {
  15647. var data = pieItem.data;
  15648. var configs = getOutsideLabelLineConfig(pieItem);
  15649. configs.forEach(function (config, i) {
  15650. config.style.lineDash = [0, data[i].labelLineLength];
  15651. });
  15652. return configs;
  15653. }
  15654. function getOutsideLabelLineShape(pieItem, i) {
  15655. var data = pieItem.data;
  15656. var dataItem = data[i];
  15657. return {
  15658. points: dataItem.labelLine
  15659. };
  15660. }
  15661. function getOutsideLabelLineStyle(pieItem, i) {
  15662. var outsideLabel = pieItem.outsideLabel,
  15663. data = pieItem.data;
  15664. var labelLineStyle = outsideLabel.labelLineStyle;
  15665. var color = data[i].color;
  15666. return (0, util$1.deepMerge)({
  15667. stroke: color,
  15668. lineDash: [data[i].labelLineLength, 0]
  15669. }, labelLineStyle);
  15670. }
  15671. function getOutsideLabelConfig(pieItem) {
  15672. var animationCurve = pieItem.animationCurve,
  15673. animationFrame = pieItem.animationFrame,
  15674. data = pieItem.data,
  15675. rLevel = pieItem.rLevel;
  15676. return data.map(function (foo, i) {
  15677. return {
  15678. name: 'text',
  15679. index: rLevel,
  15680. visible: pieItem.outsideLabel.show,
  15681. animationCurve: animationCurve,
  15682. animationFrame: animationFrame,
  15683. shape: getOutsideLabelShape(pieItem, i),
  15684. style: getOutsideLabelStyle(pieItem, i)
  15685. };
  15686. });
  15687. }
  15688. function getStartOutsideLabelConfig(pieItem) {
  15689. var data = pieItem.data;
  15690. var configs = getOutsideLabelConfig(pieItem);
  15691. configs.forEach(function (config, i) {
  15692. config.shape.position = data[i].labelLine[1];
  15693. });
  15694. return configs;
  15695. }
  15696. function getOutsideLabelShape(pieItem, i) {
  15697. var outsideLabel = pieItem.outsideLabel,
  15698. data = pieItem.data;
  15699. var formatter = outsideLabel.formatter;
  15700. var _data$i = data[i],
  15701. labelLine = _data$i.labelLine,
  15702. name = _data$i.name,
  15703. percentForLabel = _data$i.percentForLabel,
  15704. value = _data$i.value;
  15705. var formatterType = (0, _typeof2["default"])(formatter);
  15706. var label = '';
  15707. if (formatterType === 'string') {
  15708. label = formatter.replace('{name}', name);
  15709. label = label.replace('{percent}', percentForLabel);
  15710. label = label.replace('{value}', value);
  15711. }
  15712. if (formatterType === 'function') {
  15713. label = formatter(data[i]);
  15714. }
  15715. return {
  15716. content: label,
  15717. position: labelLine[2]
  15718. };
  15719. }
  15720. function getOutsideLabelStyle(pieItem, i) {
  15721. var outsideLabel = pieItem.outsideLabel,
  15722. data = pieItem.data;
  15723. var _data$i2 = data[i],
  15724. color = _data$i2.color,
  15725. align = _data$i2.align;
  15726. var style = outsideLabel.style;
  15727. return (0, util$1.deepMerge)(_objectSpread({
  15728. fill: color
  15729. }, align), style);
  15730. }
  15731. });
  15732. unwrapExports(pie_1$1);
  15733. var pie_2 = pie_1$1.pie;
  15734. var radarAxis_1$1 = createCommonjsModule(function (module, exports) {
  15735. Object.defineProperty(exports, "__esModule", {
  15736. value: true
  15737. });
  15738. exports.radarAxis = radarAxis;
  15739. var _slicedToArray2 = interopRequireDefault(slicedToArray);
  15740. var _defineProperty2 = interopRequireDefault(defineProperty);
  15741. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  15742. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  15743. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  15744. function radarAxis(chart) {
  15745. var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15746. var radar = option.radar;
  15747. var radarAxis = [];
  15748. if (radar) {
  15749. radarAxis = mergeRadarAxisDefaultConfig(radar);
  15750. radarAxis = calcRadarAxisCenter(radarAxis, chart);
  15751. radarAxis = calcRadarAxisRingRadius(radarAxis, chart);
  15752. radarAxis = calcRadarAxisLinePosition(radarAxis);
  15753. radarAxis = calcRadarAxisAreaRadius(radarAxis);
  15754. radarAxis = calcRadarAxisLabelPosition(radarAxis);
  15755. radarAxis = [radarAxis];
  15756. }
  15757. var radarAxisForUpdate = radarAxis;
  15758. if (radarAxis.length && !radarAxis[0].show) radarAxisForUpdate = [];
  15759. (0, updater_class.doUpdate)({
  15760. chart: chart,
  15761. series: radarAxisForUpdate,
  15762. key: 'radarAxisSplitArea',
  15763. getGraphConfig: getSplitAreaConfig,
  15764. beforeUpdate: beforeUpdateSplitArea,
  15765. beforeChange: beforeChangeSplitArea
  15766. });
  15767. (0, updater_class.doUpdate)({
  15768. chart: chart,
  15769. series: radarAxisForUpdate,
  15770. key: 'radarAxisSplitLine',
  15771. getGraphConfig: getSplitLineConfig,
  15772. beforeUpdate: beforeUpdateSplitLine,
  15773. beforeChange: beforeChangeSplitLine
  15774. });
  15775. (0, updater_class.doUpdate)({
  15776. chart: chart,
  15777. series: radarAxisForUpdate,
  15778. key: 'radarAxisLine',
  15779. getGraphConfig: getAxisLineConfig
  15780. });
  15781. (0, updater_class.doUpdate)({
  15782. chart: chart,
  15783. series: radarAxisForUpdate,
  15784. key: 'radarAxisLable',
  15785. getGraphConfig: getAxisLabelConfig
  15786. });
  15787. chart.radarAxis = radarAxis[0];
  15788. }
  15789. function mergeRadarAxisDefaultConfig(radar) {
  15790. return (0, util$1.deepMerge)((0, util.deepClone)(config.radarAxisConfig), radar);
  15791. }
  15792. function calcRadarAxisCenter(radarAxis, chart) {
  15793. var area = chart.render.area;
  15794. var center = radarAxis.center;
  15795. radarAxis.centerPos = center.map(function (v, i) {
  15796. if (typeof v === 'number') return v;
  15797. return parseInt(v) / 100 * area[i];
  15798. });
  15799. return radarAxis;
  15800. }
  15801. function calcRadarAxisRingRadius(radarAxis, chart) {
  15802. var area = chart.render.area;
  15803. var splitNum = radarAxis.splitNum,
  15804. radius = radarAxis.radius;
  15805. var maxRadius = Math.min.apply(Math, (0, _toConsumableArray2["default"])(area)) / 2;
  15806. if (typeof radius !== 'number') radius = parseInt(radius) / 100 * maxRadius;
  15807. var splitGap = radius / splitNum;
  15808. radarAxis.ringRadius = new Array(splitNum).fill(0).map(function (foo, i) {
  15809. return splitGap * (i + 1);
  15810. });
  15811. radarAxis.radius = radius;
  15812. return radarAxis;
  15813. }
  15814. function calcRadarAxisLinePosition(radarAxis) {
  15815. var indicator = radarAxis.indicator,
  15816. centerPos = radarAxis.centerPos,
  15817. radius = radarAxis.radius,
  15818. startAngle = radarAxis.startAngle;
  15819. var fullAngle = Math.PI * 2;
  15820. var indicatorNum = indicator.length;
  15821. var indicatorGap = fullAngle / indicatorNum;
  15822. var angles = new Array(indicatorNum).fill(0).map(function (foo, i) {
  15823. return indicatorGap * i + startAngle;
  15824. });
  15825. radarAxis.axisLineAngles = angles;
  15826. radarAxis.axisLinePosition = angles.map(function (g) {
  15827. return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([radius, g]));
  15828. });
  15829. return radarAxis;
  15830. }
  15831. function calcRadarAxisAreaRadius(radarAxis) {
  15832. var ringRadius = radarAxis.ringRadius;
  15833. var subRadius = ringRadius[0] / 2;
  15834. radarAxis.areaRadius = ringRadius.map(function (r) {
  15835. return r - subRadius;
  15836. });
  15837. return radarAxis;
  15838. }
  15839. function calcRadarAxisLabelPosition(radarAxis) {
  15840. var axisLineAngles = radarAxis.axisLineAngles,
  15841. centerPos = radarAxis.centerPos,
  15842. radius = radarAxis.radius,
  15843. axisLabel = radarAxis.axisLabel;
  15844. radius += axisLabel.labelGap;
  15845. radarAxis.axisLabelPosition = axisLineAngles.map(function (angle) {
  15846. return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([radius, angle]));
  15847. });
  15848. return radarAxis;
  15849. }
  15850. function getSplitAreaConfig(radarAxis) {
  15851. var areaRadius = radarAxis.areaRadius,
  15852. polygon = radarAxis.polygon,
  15853. animationCurve = radarAxis.animationCurve,
  15854. animationFrame = radarAxis.animationFrame,
  15855. rLevel = radarAxis.rLevel;
  15856. var name = polygon ? 'regPolygon' : 'ring';
  15857. return areaRadius.map(function (foo, i) {
  15858. return {
  15859. name: name,
  15860. index: rLevel,
  15861. visible: radarAxis.splitArea.show,
  15862. animationCurve: animationCurve,
  15863. animationFrame: animationFrame,
  15864. shape: getSplitAreaShape(radarAxis, i),
  15865. style: getSplitAreaStyle(radarAxis, i)
  15866. };
  15867. });
  15868. }
  15869. function getSplitAreaShape(radarAxis, i) {
  15870. var polygon = radarAxis.polygon,
  15871. areaRadius = radarAxis.areaRadius,
  15872. indicator = radarAxis.indicator,
  15873. centerPos = radarAxis.centerPos;
  15874. var indicatorNum = indicator.length;
  15875. var shape = {
  15876. rx: centerPos[0],
  15877. ry: centerPos[1],
  15878. r: areaRadius[i]
  15879. };
  15880. if (polygon) shape.side = indicatorNum;
  15881. return shape;
  15882. }
  15883. function getSplitAreaStyle(radarAxis, i) {
  15884. var splitArea = radarAxis.splitArea,
  15885. ringRadius = radarAxis.ringRadius,
  15886. axisLineAngles = radarAxis.axisLineAngles,
  15887. polygon = radarAxis.polygon,
  15888. centerPos = radarAxis.centerPos;
  15889. var color = splitArea.color,
  15890. style = splitArea.style;
  15891. style = _objectSpread({
  15892. fill: 'rgba(0, 0, 0, 0)'
  15893. }, style);
  15894. var lineWidth = ringRadius[0] - 0;
  15895. if (polygon) {
  15896. var point1 = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([ringRadius[0], axisLineAngles[0]]));
  15897. var point2 = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([ringRadius[0], axisLineAngles[1]]));
  15898. lineWidth = (0, util$1.getPointToLineDistance)(centerPos, point1, point2);
  15899. }
  15900. style = (0, util$1.deepMerge)((0, util.deepClone)(style, true), {
  15901. lineWidth: lineWidth
  15902. });
  15903. if (!color.length) return style;
  15904. var colorNum = color.length;
  15905. return (0, util$1.deepMerge)(style, {
  15906. stroke: color[i % colorNum]
  15907. });
  15908. }
  15909. function beforeUpdateSplitArea(graphs, radarAxis, i, updater) {
  15910. var cache = graphs[i];
  15911. if (!cache) return;
  15912. var render = updater.chart.render;
  15913. var polygon = radarAxis.polygon;
  15914. var name = cache[0].name;
  15915. var currentName = polygon ? 'regPolygon' : 'ring';
  15916. var delAll = currentName !== name;
  15917. if (!delAll) return;
  15918. cache.forEach(function (g) {
  15919. return render.delGraph(g);
  15920. });
  15921. graphs[i] = null;
  15922. }
  15923. function beforeChangeSplitArea(graph, config) {
  15924. var side = config.shape.side;
  15925. if (typeof side !== 'number') return;
  15926. graph.shape.side = side;
  15927. }
  15928. function getSplitLineConfig(radarAxis) {
  15929. var ringRadius = radarAxis.ringRadius,
  15930. polygon = radarAxis.polygon,
  15931. animationCurve = radarAxis.animationCurve,
  15932. animationFrame = radarAxis.animationFrame,
  15933. rLevel = radarAxis.rLevel;
  15934. var name = polygon ? 'regPolygon' : 'ring';
  15935. return ringRadius.map(function (foo, i) {
  15936. return {
  15937. name: name,
  15938. index: rLevel,
  15939. animationCurve: animationCurve,
  15940. animationFrame: animationFrame,
  15941. visible: radarAxis.splitLine.show,
  15942. shape: getSplitLineShape(radarAxis, i),
  15943. style: getSplitLineStyle(radarAxis, i)
  15944. };
  15945. });
  15946. }
  15947. function getSplitLineShape(radarAxis, i) {
  15948. var ringRadius = radarAxis.ringRadius,
  15949. centerPos = radarAxis.centerPos,
  15950. indicator = radarAxis.indicator,
  15951. polygon = radarAxis.polygon;
  15952. var shape = {
  15953. rx: centerPos[0],
  15954. ry: centerPos[1],
  15955. r: ringRadius[i]
  15956. };
  15957. var indicatorNum = indicator.length;
  15958. if (polygon) shape.side = indicatorNum;
  15959. return shape;
  15960. }
  15961. function getSplitLineStyle(radarAxis, i) {
  15962. var splitLine = radarAxis.splitLine;
  15963. var color = splitLine.color,
  15964. style = splitLine.style;
  15965. style = _objectSpread({
  15966. fill: 'rgba(0, 0, 0, 0)'
  15967. }, style);
  15968. if (!color.length) return style;
  15969. var colorNum = color.length;
  15970. return (0, util$1.deepMerge)(style, {
  15971. stroke: color[i % colorNum]
  15972. });
  15973. }
  15974. function beforeUpdateSplitLine(graphs, radarAxis, i, updater) {
  15975. var cache = graphs[i];
  15976. if (!cache) return;
  15977. var render = updater.chart.render;
  15978. var polygon = radarAxis.polygon;
  15979. var name = cache[0].name;
  15980. var currenName = polygon ? 'regPolygon' : 'ring';
  15981. var delAll = currenName !== name;
  15982. if (!delAll) return;
  15983. cache.forEach(function (g) {
  15984. return render.delGraph(g);
  15985. });
  15986. graphs[i] = null;
  15987. }
  15988. function beforeChangeSplitLine(graph, config) {
  15989. var side = config.shape.side;
  15990. if (typeof side !== 'number') return;
  15991. graph.shape.side = side;
  15992. }
  15993. function getAxisLineConfig(radarAxis) {
  15994. var axisLinePosition = radarAxis.axisLinePosition,
  15995. animationCurve = radarAxis.animationCurve,
  15996. animationFrame = radarAxis.animationFrame,
  15997. rLevel = radarAxis.rLevel;
  15998. return axisLinePosition.map(function (foo, i) {
  15999. return {
  16000. name: 'polyline',
  16001. index: rLevel,
  16002. visible: radarAxis.axisLine.show,
  16003. animationCurve: animationCurve,
  16004. animationFrame: animationFrame,
  16005. shape: getAxisLineShape(radarAxis, i),
  16006. style: getAxisLineStyle(radarAxis, i)
  16007. };
  16008. });
  16009. }
  16010. function getAxisLineShape(radarAxis, i) {
  16011. var centerPos = radarAxis.centerPos,
  16012. axisLinePosition = radarAxis.axisLinePosition;
  16013. var points = [centerPos, axisLinePosition[i]];
  16014. return {
  16015. points: points
  16016. };
  16017. }
  16018. function getAxisLineStyle(radarAxis, i) {
  16019. var axisLine = radarAxis.axisLine;
  16020. var color = axisLine.color,
  16021. style = axisLine.style;
  16022. if (!color.length) return style;
  16023. var colorNum = color.length;
  16024. return (0, util$1.deepMerge)(style, {
  16025. stroke: color[i % colorNum]
  16026. });
  16027. }
  16028. function getAxisLabelConfig(radarAxis) {
  16029. var axisLabelPosition = radarAxis.axisLabelPosition,
  16030. animationCurve = radarAxis.animationCurve,
  16031. animationFrame = radarAxis.animationFrame,
  16032. rLevel = radarAxis.rLevel;
  16033. return axisLabelPosition.map(function (foo, i) {
  16034. return {
  16035. name: 'text',
  16036. index: rLevel,
  16037. visible: radarAxis.axisLabel.show,
  16038. animationCurve: animationCurve,
  16039. animationFrame: animationFrame,
  16040. shape: getAxisLableShape(radarAxis, i),
  16041. style: getAxisLableStyle(radarAxis, i)
  16042. };
  16043. });
  16044. }
  16045. function getAxisLableShape(radarAxis, i) {
  16046. var axisLabelPosition = radarAxis.axisLabelPosition,
  16047. indicator = radarAxis.indicator;
  16048. return {
  16049. content: indicator[i].name,
  16050. position: axisLabelPosition[i]
  16051. };
  16052. }
  16053. function getAxisLableStyle(radarAxis, i) {
  16054. var axisLabel = radarAxis.axisLabel,
  16055. _radarAxis$centerPos = (0, _slicedToArray2["default"])(radarAxis.centerPos, 2),
  16056. x = _radarAxis$centerPos[0],
  16057. y = _radarAxis$centerPos[1],
  16058. axisLabelPosition = radarAxis.axisLabelPosition;
  16059. var color = axisLabel.color,
  16060. style = axisLabel.style;
  16061. var _axisLabelPosition$i = (0, _slicedToArray2["default"])(axisLabelPosition[i], 2),
  16062. labelXpos = _axisLabelPosition$i[0],
  16063. labelYPos = _axisLabelPosition$i[1];
  16064. var textAlign = labelXpos > x ? 'left' : 'right';
  16065. var textBaseline = labelYPos > y ? 'top' : 'bottom';
  16066. style = (0, util$1.deepMerge)({
  16067. textAlign: textAlign,
  16068. textBaseline: textBaseline
  16069. }, style);
  16070. if (!color.length) return style;
  16071. var colorNum = color.length;
  16072. return (0, util$1.deepMerge)(style, {
  16073. fill: color[i % colorNum]
  16074. });
  16075. }
  16076. });
  16077. unwrapExports(radarAxis_1$1);
  16078. var radarAxis_2 = radarAxis_1$1.radarAxis;
  16079. var radar_1$1 = createCommonjsModule(function (module, exports) {
  16080. Object.defineProperty(exports, "__esModule", {
  16081. value: true
  16082. });
  16083. exports.radar = radar;
  16084. var _defineProperty2 = interopRequireDefault(defineProperty);
  16085. var _typeof2 = interopRequireDefault(_typeof_1);
  16086. var _slicedToArray2 = interopRequireDefault(slicedToArray);
  16087. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  16088. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  16089. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  16090. function radar(chart) {
  16091. var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16092. var series = option.series;
  16093. if (!series) series = [];
  16094. var radars = (0, util$1.initNeedSeries)(series, config.radarConfig, 'radar');
  16095. radars = calcRadarPosition(radars, chart);
  16096. radars = calcRadarLabelPosition(radars, chart);
  16097. radars = calcRadarLabelAlign(radars, chart);
  16098. (0, updater_class.doUpdate)({
  16099. chart: chart,
  16100. series: radars,
  16101. key: 'radar',
  16102. getGraphConfig: getRadarConfig,
  16103. getStartGraphConfig: getStartRadarConfig,
  16104. beforeChange: beforeChangeRadar
  16105. });
  16106. (0, updater_class.doUpdate)({
  16107. chart: chart,
  16108. series: radars,
  16109. key: 'radarPoint',
  16110. getGraphConfig: getPointConfig,
  16111. getStartGraphConfig: getStartPointConfig
  16112. });
  16113. (0, updater_class.doUpdate)({
  16114. chart: chart,
  16115. series: radars,
  16116. key: 'radarLabel',
  16117. getGraphConfig: getLabelConfig
  16118. });
  16119. }
  16120. function calcRadarPosition(radars, chart) {
  16121. var radarAxis = chart.radarAxis;
  16122. if (!radarAxis) return [];
  16123. var indicator = radarAxis.indicator,
  16124. axisLineAngles = radarAxis.axisLineAngles,
  16125. radius = radarAxis.radius,
  16126. centerPos = radarAxis.centerPos;
  16127. radars.forEach(function (radarItem) {
  16128. var data = radarItem.data;
  16129. radarItem.dataRadius = [];
  16130. radarItem.radarPosition = indicator.map(function (_ref, i) {
  16131. var max = _ref.max,
  16132. min = _ref.min;
  16133. var v = data[i];
  16134. if (typeof max !== 'number') max = v;
  16135. if (typeof min !== 'number') min = 0;
  16136. if (typeof v !== 'number') v = min;
  16137. var dataRadius = (v - min) / (max - min) * radius;
  16138. radarItem.dataRadius[i] = dataRadius;
  16139. return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([dataRadius, axisLineAngles[i]]));
  16140. });
  16141. });
  16142. return radars;
  16143. }
  16144. function calcRadarLabelPosition(radars, chart) {
  16145. var radarAxis = chart.radarAxis;
  16146. if (!radarAxis) return [];
  16147. var centerPos = radarAxis.centerPos,
  16148. axisLineAngles = radarAxis.axisLineAngles;
  16149. radars.forEach(function (radarItem) {
  16150. var dataRadius = radarItem.dataRadius,
  16151. label = radarItem.label;
  16152. var labelGap = label.labelGap;
  16153. radarItem.labelPosition = dataRadius.map(function (r, i) {
  16154. return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([r + labelGap, axisLineAngles[i]]));
  16155. });
  16156. });
  16157. return radars;
  16158. }
  16159. function calcRadarLabelAlign(radars, chart) {
  16160. var radarAxis = chart.radarAxis;
  16161. if (!radarAxis) return [];
  16162. var _radarAxis$centerPos = (0, _slicedToArray2["default"])(radarAxis.centerPos, 2),
  16163. x = _radarAxis$centerPos[0],
  16164. y = _radarAxis$centerPos[1];
  16165. radars.forEach(function (radarItem) {
  16166. var labelPosition = radarItem.labelPosition;
  16167. var labelAlign = labelPosition.map(function (_ref2) {
  16168. var _ref3 = (0, _slicedToArray2["default"])(_ref2, 2),
  16169. lx = _ref3[0],
  16170. ly = _ref3[1];
  16171. var textAlign = lx > x ? 'left' : 'right';
  16172. var textBaseline = ly > y ? 'top' : 'bottom';
  16173. return {
  16174. textAlign: textAlign,
  16175. textBaseline: textBaseline
  16176. };
  16177. });
  16178. radarItem.labelAlign = labelAlign;
  16179. });
  16180. return radars;
  16181. }
  16182. function getRadarConfig(radarItem) {
  16183. var animationCurve = radarItem.animationCurve,
  16184. animationFrame = radarItem.animationFrame,
  16185. rLevel = radarItem.rLevel;
  16186. return [{
  16187. name: 'polyline',
  16188. index: rLevel,
  16189. animationCurve: animationCurve,
  16190. animationFrame: animationFrame,
  16191. shape: getRadarShape(radarItem),
  16192. style: getRadarStyle(radarItem)
  16193. }];
  16194. }
  16195. function getStartRadarConfig(radarItem, updater) {
  16196. var centerPos = updater.chart.radarAxis.centerPos;
  16197. var config = getRadarConfig(radarItem)[0];
  16198. var pointNum = config.shape.points.length;
  16199. var points = new Array(pointNum).fill(0).map(function (foo) {
  16200. return (0, _toConsumableArray2["default"])(centerPos);
  16201. });
  16202. config.shape.points = points;
  16203. return [config];
  16204. }
  16205. function getRadarShape(radarItem) {
  16206. var radarPosition = radarItem.radarPosition;
  16207. return {
  16208. points: radarPosition,
  16209. close: true
  16210. };
  16211. }
  16212. function getRadarStyle(radarItem) {
  16213. var radarStyle = radarItem.radarStyle,
  16214. color = radarItem.color;
  16215. var colorRgbaValue = (0, lib.getRgbaValue)(color);
  16216. colorRgbaValue[3] = 0.5;
  16217. var radarDefaultColor = {
  16218. stroke: color,
  16219. fill: (0, lib.getColorFromRgbValue)(colorRgbaValue)
  16220. };
  16221. return (0, util$1.deepMerge)(radarDefaultColor, radarStyle);
  16222. }
  16223. function beforeChangeRadar(graph, _ref4) {
  16224. var shape = _ref4.shape;
  16225. var graphPoints = graph.shape.points;
  16226. var graphPointsNum = graphPoints.length;
  16227. var pointsNum = shape.points.length;
  16228. if (pointsNum > graphPointsNum) {
  16229. var lastPoint = graphPoints.slice(-1)[0];
  16230. var newAddPoints = new Array(pointsNum - graphPointsNum).fill(0).map(function (foo) {
  16231. return (0, _toConsumableArray2["default"])(lastPoint);
  16232. });
  16233. graphPoints.push.apply(graphPoints, (0, _toConsumableArray2["default"])(newAddPoints));
  16234. } else if (pointsNum < graphPointsNum) {
  16235. graphPoints.splice(pointsNum);
  16236. }
  16237. }
  16238. function getPointConfig(radarItem) {
  16239. var radarPosition = radarItem.radarPosition,
  16240. animationCurve = radarItem.animationCurve,
  16241. animationFrame = radarItem.animationFrame,
  16242. rLevel = radarItem.rLevel;
  16243. return radarPosition.map(function (foo, i) {
  16244. return {
  16245. name: 'circle',
  16246. index: rLevel,
  16247. animationCurve: animationCurve,
  16248. animationFrame: animationFrame,
  16249. visible: radarItem.point.show,
  16250. shape: getPointShape(radarItem, i),
  16251. style: getPointStyle(radarItem)
  16252. };
  16253. });
  16254. }
  16255. function getStartPointConfig(radarItem) {
  16256. var configs = getPointConfig(radarItem);
  16257. configs.forEach(function (config) {
  16258. return config.shape.r = 0.01;
  16259. });
  16260. return configs;
  16261. }
  16262. function getPointShape(radarItem, i) {
  16263. var radarPosition = radarItem.radarPosition,
  16264. point = radarItem.point;
  16265. var radius = point.radius;
  16266. var position = radarPosition[i];
  16267. return {
  16268. rx: position[0],
  16269. ry: position[1],
  16270. r: radius
  16271. };
  16272. }
  16273. function getPointStyle(radarItem, i) {
  16274. var point = radarItem.point,
  16275. color = radarItem.color;
  16276. var style = point.style;
  16277. return (0, util$1.deepMerge)({
  16278. stroke: color
  16279. }, style);
  16280. }
  16281. function getLabelConfig(radarItem) {
  16282. var labelPosition = radarItem.labelPosition,
  16283. animationCurve = radarItem.animationCurve,
  16284. animationFrame = radarItem.animationFrame,
  16285. rLevel = radarItem.rLevel;
  16286. return labelPosition.map(function (foo, i) {
  16287. return {
  16288. name: 'text',
  16289. index: rLevel,
  16290. visible: radarItem.label.show,
  16291. animationCurve: animationCurve,
  16292. animationFrame: animationFrame,
  16293. shape: getLabelShape(radarItem, i),
  16294. style: getLabelStyle(radarItem, i)
  16295. };
  16296. });
  16297. }
  16298. function getLabelShape(radarItem, i) {
  16299. var labelPosition = radarItem.labelPosition,
  16300. label = radarItem.label,
  16301. data = radarItem.data;
  16302. var offset = label.offset,
  16303. formatter = label.formatter;
  16304. var position = mergePointOffset(labelPosition[i], offset);
  16305. var labelText = data[i] ? data[i].toString() : '0';
  16306. var formatterType = (0, _typeof2["default"])(formatter);
  16307. if (formatterType === 'string') labelText = formatter.replace('{value}', labelText);
  16308. if (formatterType === 'function') labelText = formatter(labelText);
  16309. return {
  16310. content: labelText,
  16311. position: position
  16312. };
  16313. }
  16314. function mergePointOffset(_ref5, _ref6) {
  16315. var _ref7 = (0, _slicedToArray2["default"])(_ref5, 2),
  16316. x = _ref7[0],
  16317. y = _ref7[1];
  16318. var _ref8 = (0, _slicedToArray2["default"])(_ref6, 2),
  16319. ox = _ref8[0],
  16320. oy = _ref8[1];
  16321. return [x + ox, y + oy];
  16322. }
  16323. function getLabelStyle(radarItem, i) {
  16324. var label = radarItem.label,
  16325. color = radarItem.color,
  16326. labelAlign = radarItem.labelAlign;
  16327. var style = label.style;
  16328. var defaultColorAndAlign = _objectSpread({
  16329. fill: color
  16330. }, labelAlign[i]);
  16331. return (0, util$1.deepMerge)(defaultColorAndAlign, style);
  16332. }
  16333. });
  16334. unwrapExports(radar_1$1);
  16335. var radar_2 = radar_1$1.radar;
  16336. var gauge_1$1 = createCommonjsModule(function (module, exports) {
  16337. Object.defineProperty(exports, "__esModule", {
  16338. value: true
  16339. });
  16340. exports.gauge = gauge$1;
  16341. var _defineProperty2 = interopRequireDefault(defineProperty);
  16342. var _typeof2 = interopRequireDefault(_typeof_1);
  16343. var _slicedToArray2 = interopRequireDefault(slicedToArray);
  16344. var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
  16345. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  16346. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  16347. function gauge$1(chart) {
  16348. var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16349. var series = option.series;
  16350. if (!series) series = [];
  16351. var gauges = (0, util$1.initNeedSeries)(series, gauge.gaugeConfig, 'gauge');
  16352. gauges = calcGaugesCenter(gauges, chart);
  16353. gauges = calcGaugesRadius(gauges, chart);
  16354. gauges = calcGaugesDataRadiusAndLineWidth(gauges, chart);
  16355. gauges = calcGaugesDataAngles(gauges);
  16356. gauges = calcGaugesDataGradient(gauges);
  16357. gauges = calcGaugesAxisTickPosition(gauges);
  16358. gauges = calcGaugesLabelPositionAndAlign(gauges);
  16359. gauges = calcGaugesLabelData(gauges);
  16360. gauges = calcGaugesDetailsPosition(gauges);
  16361. gauges = calcGaugesDetailsContent(gauges);
  16362. (0, updater_class.doUpdate)({
  16363. chart: chart,
  16364. series: gauges,
  16365. key: 'gaugeAxisTick',
  16366. getGraphConfig: getAxisTickConfig
  16367. });
  16368. (0, updater_class.doUpdate)({
  16369. chart: chart,
  16370. series: gauges,
  16371. key: 'gaugeAxisLabel',
  16372. getGraphConfig: getAxisLabelConfig
  16373. });
  16374. (0, updater_class.doUpdate)({
  16375. chart: chart,
  16376. series: gauges,
  16377. key: 'gaugeBackgroundArc',
  16378. getGraphConfig: getBackgroundArcConfig,
  16379. getStartGraphConfig: getStartBackgroundArcConfig
  16380. });
  16381. (0, updater_class.doUpdate)({
  16382. chart: chart,
  16383. series: gauges,
  16384. key: 'gaugeArc',
  16385. getGraphConfig: getArcConfig,
  16386. getStartGraphConfig: getStartArcConfig,
  16387. beforeChange: beforeChangeArc
  16388. });
  16389. (0, updater_class.doUpdate)({
  16390. chart: chart,
  16391. series: gauges,
  16392. key: 'gaugePointer',
  16393. getGraphConfig: getPointerConfig,
  16394. getStartGraphConfig: getStartPointerConfig
  16395. });
  16396. (0, updater_class.doUpdate)({
  16397. chart: chart,
  16398. series: gauges,
  16399. key: 'gaugeDetails',
  16400. getGraphConfig: getDetailsConfig
  16401. });
  16402. }
  16403. function calcGaugesCenter(gauges, chart) {
  16404. var area = chart.render.area;
  16405. gauges.forEach(function (gaugeItem) {
  16406. var center = gaugeItem.center;
  16407. center = center.map(function (pos, i) {
  16408. if (typeof pos === 'number') return pos;
  16409. return parseInt(pos) / 100 * area[i];
  16410. });
  16411. gaugeItem.center = center;
  16412. });
  16413. return gauges;
  16414. }
  16415. function calcGaugesRadius(gauges, chart) {
  16416. var area = chart.render.area;
  16417. var maxRadius = Math.min.apply(Math, (0, _toConsumableArray2["default"])(area)) / 2;
  16418. gauges.forEach(function (gaugeItem) {
  16419. var radius = gaugeItem.radius;
  16420. if (typeof radius !== 'number') {
  16421. radius = parseInt(radius) / 100 * maxRadius;
  16422. }
  16423. gaugeItem.radius = radius;
  16424. });
  16425. return gauges;
  16426. }
  16427. function calcGaugesDataRadiusAndLineWidth(gauges, chart) {
  16428. var area = chart.render.area;
  16429. var maxRadius = Math.min.apply(Math, (0, _toConsumableArray2["default"])(area)) / 2;
  16430. gauges.forEach(function (gaugeItem) {
  16431. var radius = gaugeItem.radius,
  16432. data = gaugeItem.data,
  16433. arcLineWidth = gaugeItem.arcLineWidth;
  16434. data.forEach(function (item) {
  16435. var arcRadius = item.radius,
  16436. lineWidth = item.lineWidth;
  16437. if (!arcRadius) arcRadius = radius;
  16438. if (typeof arcRadius !== 'number') arcRadius = parseInt(arcRadius) / 100 * maxRadius;
  16439. item.radius = arcRadius;
  16440. if (!lineWidth) lineWidth = arcLineWidth;
  16441. item.lineWidth = lineWidth;
  16442. });
  16443. });
  16444. return gauges;
  16445. }
  16446. function calcGaugesDataAngles(gauges, chart) {
  16447. gauges.forEach(function (gaugeItem) {
  16448. var startAngle = gaugeItem.startAngle,
  16449. endAngle = gaugeItem.endAngle,
  16450. data = gaugeItem.data,
  16451. min = gaugeItem.min,
  16452. max = gaugeItem.max;
  16453. var angleMinus = endAngle - startAngle;
  16454. var valueMinus = max - min;
  16455. data.forEach(function (item) {
  16456. var value = item.value;
  16457. var itemAngle = Math.abs((value - min) / valueMinus * angleMinus);
  16458. item.startAngle = startAngle;
  16459. item.endAngle = startAngle + itemAngle;
  16460. });
  16461. });
  16462. return gauges;
  16463. }
  16464. function calcGaugesDataGradient(gauges, chart) {
  16465. gauges.forEach(function (gaugeItem) {
  16466. var data = gaugeItem.data;
  16467. data.forEach(function (item) {
  16468. var color = item.color,
  16469. gradient = item.gradient;
  16470. if (!gradient || !gradient.length) gradient = color;
  16471. if (!(gradient instanceof Array)) gradient = [gradient];
  16472. item.gradient = gradient;
  16473. });
  16474. });
  16475. return gauges;
  16476. }
  16477. function calcGaugesAxisTickPosition(gauges, chart) {
  16478. gauges.forEach(function (gaugeItem) {
  16479. var startAngle = gaugeItem.startAngle,
  16480. endAngle = gaugeItem.endAngle,
  16481. splitNum = gaugeItem.splitNum,
  16482. center = gaugeItem.center,
  16483. radius = gaugeItem.radius,
  16484. arcLineWidth = gaugeItem.arcLineWidth,
  16485. axisTick = gaugeItem.axisTick;
  16486. var tickLength = axisTick.tickLength,
  16487. lineWidth = axisTick.style.lineWidth;
  16488. var angles = endAngle - startAngle;
  16489. var outerRadius = radius - arcLineWidth / 2;
  16490. var innerRadius = outerRadius - tickLength;
  16491. var angleGap = angles / (splitNum - 1);
  16492. var arcLength = 2 * Math.PI * radius * angles / (Math.PI * 2);
  16493. var offset = Math.ceil(lineWidth / 2) / arcLength * angles;
  16494. gaugeItem.tickAngles = [];
  16495. gaugeItem.tickInnerRadius = [];
  16496. gaugeItem.tickPosition = new Array(splitNum).fill(0).map(function (foo, i) {
  16497. var angle = startAngle + angleGap * i;
  16498. if (i === 0) angle += offset;
  16499. if (i === splitNum - 1) angle -= offset;
  16500. gaugeItem.tickAngles[i] = angle;
  16501. gaugeItem.tickInnerRadius[i] = innerRadius;
  16502. return [util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([outerRadius, angle])), util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([innerRadius, angle]))];
  16503. });
  16504. });
  16505. return gauges;
  16506. }
  16507. function calcGaugesLabelPositionAndAlign(gauges, chart) {
  16508. gauges.forEach(function (gaugeItem) {
  16509. var center = gaugeItem.center,
  16510. tickInnerRadius = gaugeItem.tickInnerRadius,
  16511. tickAngles = gaugeItem.tickAngles,
  16512. labelGap = gaugeItem.axisLabel.labelGap;
  16513. var position = tickAngles.map(function (angle, i) {
  16514. return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([tickInnerRadius[i] - labelGap, tickAngles[i]]));
  16515. });
  16516. var align = position.map(function (_ref) {
  16517. var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
  16518. x = _ref2[0],
  16519. y = _ref2[1];
  16520. return {
  16521. textAlign: x > center[0] ? 'right' : 'left',
  16522. textBaseline: y > center[1] ? 'bottom' : 'top'
  16523. };
  16524. });
  16525. gaugeItem.labelPosition = position;
  16526. gaugeItem.labelAlign = align;
  16527. });
  16528. return gauges;
  16529. }
  16530. function calcGaugesLabelData(gauges, chart) {
  16531. gauges.forEach(function (gaugeItem) {
  16532. var axisLabel = gaugeItem.axisLabel,
  16533. min = gaugeItem.min,
  16534. max = gaugeItem.max,
  16535. splitNum = gaugeItem.splitNum;
  16536. var data = axisLabel.data,
  16537. formatter = axisLabel.formatter;
  16538. var valueGap = (max - min) / (splitNum - 1);
  16539. var value = new Array(splitNum).fill(0).map(function (foo, i) {
  16540. return parseInt(min + valueGap * i);
  16541. });
  16542. var formatterType = (0, _typeof2["default"])(formatter);
  16543. data = (0, util$1.deepMerge)(value, data).map(function (v, i) {
  16544. var label = v;
  16545. if (formatterType === 'string') {
  16546. label = formatter.replace('{value}', v);
  16547. }
  16548. if (formatterType === 'function') {
  16549. label = formatter({
  16550. value: v,
  16551. index: i
  16552. });
  16553. }
  16554. return label;
  16555. });
  16556. axisLabel.data = data;
  16557. });
  16558. return gauges;
  16559. }
  16560. function calcGaugesDetailsPosition(gauges, chart) {
  16561. gauges.forEach(function (gaugeItem) {
  16562. var data = gaugeItem.data,
  16563. details = gaugeItem.details,
  16564. center = gaugeItem.center;
  16565. var position = details.position,
  16566. offset = details.offset;
  16567. var detailsPosition = data.map(function (_ref3) {
  16568. var startAngle = _ref3.startAngle,
  16569. endAngle = _ref3.endAngle,
  16570. radius = _ref3.radius;
  16571. var point = null;
  16572. if (position === 'center') {
  16573. point = center;
  16574. } else if (position === 'start') {
  16575. point = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([radius, startAngle]));
  16576. } else if (position === 'end') {
  16577. point = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([radius, endAngle]));
  16578. }
  16579. return getOffsetedPoint(point, offset);
  16580. });
  16581. gaugeItem.detailsPosition = detailsPosition;
  16582. });
  16583. return gauges;
  16584. }
  16585. function calcGaugesDetailsContent(gauges, chart) {
  16586. gauges.forEach(function (gaugeItem) {
  16587. var data = gaugeItem.data,
  16588. details = gaugeItem.details;
  16589. var formatter = details.formatter;
  16590. var formatterType = (0, _typeof2["default"])(formatter);
  16591. var contents = data.map(function (dataItem) {
  16592. var content = dataItem.value;
  16593. if (formatterType === 'string') {
  16594. content = formatter.replace('{value}', '{nt}');
  16595. content = content.replace('{name}', dataItem.name);
  16596. }
  16597. if (formatterType === 'function') content = formatter(dataItem);
  16598. return content.toString();
  16599. });
  16600. gaugeItem.detailsContent = contents;
  16601. });
  16602. return gauges;
  16603. }
  16604. function getOffsetedPoint(_ref4, _ref5) {
  16605. var _ref6 = (0, _slicedToArray2["default"])(_ref4, 2),
  16606. x = _ref6[0],
  16607. y = _ref6[1];
  16608. var _ref7 = (0, _slicedToArray2["default"])(_ref5, 2),
  16609. ox = _ref7[0],
  16610. oy = _ref7[1];
  16611. return [x + ox, y + oy];
  16612. }
  16613. function getAxisTickConfig(gaugeItem) {
  16614. var tickPosition = gaugeItem.tickPosition,
  16615. animationCurve = gaugeItem.animationCurve,
  16616. animationFrame = gaugeItem.animationFrame,
  16617. rLevel = gaugeItem.rLevel;
  16618. return tickPosition.map(function (foo, i) {
  16619. return {
  16620. name: 'polyline',
  16621. index: rLevel,
  16622. visible: gaugeItem.axisTick.show,
  16623. animationCurve: animationCurve,
  16624. animationFrame: animationFrame,
  16625. shape: getAxisTickShape(gaugeItem, i),
  16626. style: getAxisTickStyle(gaugeItem)
  16627. };
  16628. });
  16629. }
  16630. function getAxisTickShape(gaugeItem, i) {
  16631. var tickPosition = gaugeItem.tickPosition;
  16632. return {
  16633. points: tickPosition[i]
  16634. };
  16635. }
  16636. function getAxisTickStyle(gaugeItem, i) {
  16637. var style = gaugeItem.axisTick.style;
  16638. return style;
  16639. }
  16640. function getAxisLabelConfig(gaugeItem) {
  16641. var labelPosition = gaugeItem.labelPosition,
  16642. animationCurve = gaugeItem.animationCurve,
  16643. animationFrame = gaugeItem.animationFrame,
  16644. rLevel = gaugeItem.rLevel;
  16645. return labelPosition.map(function (foo, i) {
  16646. return {
  16647. name: 'text',
  16648. index: rLevel,
  16649. visible: gaugeItem.axisLabel.show,
  16650. animationCurve: animationCurve,
  16651. animationFrame: animationFrame,
  16652. shape: getAxisLabelShape(gaugeItem, i),
  16653. style: getAxisLabelStyle(gaugeItem, i)
  16654. };
  16655. });
  16656. }
  16657. function getAxisLabelShape(gaugeItem, i) {
  16658. var labelPosition = gaugeItem.labelPosition,
  16659. data = gaugeItem.axisLabel.data;
  16660. return {
  16661. content: data[i].toString(),
  16662. position: labelPosition[i]
  16663. };
  16664. }
  16665. function getAxisLabelStyle(gaugeItem, i) {
  16666. var labelAlign = gaugeItem.labelAlign,
  16667. axisLabel = gaugeItem.axisLabel;
  16668. var style = axisLabel.style;
  16669. return (0, util$1.deepMerge)(_objectSpread({}, labelAlign[i]), style);
  16670. }
  16671. function getBackgroundArcConfig(gaugeItem) {
  16672. var animationCurve = gaugeItem.animationCurve,
  16673. animationFrame = gaugeItem.animationFrame,
  16674. rLevel = gaugeItem.rLevel;
  16675. return [{
  16676. name: 'arc',
  16677. index: rLevel,
  16678. visible: gaugeItem.backgroundArc.show,
  16679. animationCurve: animationCurve,
  16680. animationFrame: animationFrame,
  16681. shape: getGaugeBackgroundArcShape(gaugeItem),
  16682. style: getGaugeBackgroundArcStyle(gaugeItem)
  16683. }];
  16684. }
  16685. function getGaugeBackgroundArcShape(gaugeItem) {
  16686. var startAngle = gaugeItem.startAngle,
  16687. endAngle = gaugeItem.endAngle,
  16688. center = gaugeItem.center,
  16689. radius = gaugeItem.radius;
  16690. return {
  16691. rx: center[0],
  16692. ry: center[1],
  16693. r: radius,
  16694. startAngle: startAngle,
  16695. endAngle: endAngle
  16696. };
  16697. }
  16698. function getGaugeBackgroundArcStyle(gaugeItem) {
  16699. var backgroundArc = gaugeItem.backgroundArc,
  16700. arcLineWidth = gaugeItem.arcLineWidth;
  16701. var style = backgroundArc.style;
  16702. return (0, util$1.deepMerge)({
  16703. lineWidth: arcLineWidth
  16704. }, style);
  16705. }
  16706. function getStartBackgroundArcConfig(gaugeItem) {
  16707. var config = getBackgroundArcConfig(gaugeItem)[0];
  16708. var shape = _objectSpread({}, config.shape);
  16709. shape.endAngle = config.shape.startAngle;
  16710. config.shape = shape;
  16711. return [config];
  16712. }
  16713. function getArcConfig(gaugeItem) {
  16714. var data = gaugeItem.data,
  16715. animationCurve = gaugeItem.animationCurve,
  16716. animationFrame = gaugeItem.animationFrame,
  16717. rLevel = gaugeItem.rLevel;
  16718. return data.map(function (foo, i) {
  16719. return {
  16720. name: 'agArc',
  16721. index: rLevel,
  16722. animationCurve: animationCurve,
  16723. animationFrame: animationFrame,
  16724. shape: getGaugeArcShape(gaugeItem, i),
  16725. style: getGaugeArcStyle(gaugeItem, i)
  16726. };
  16727. });
  16728. }
  16729. function getGaugeArcShape(gaugeItem, i) {
  16730. var data = gaugeItem.data,
  16731. center = gaugeItem.center,
  16732. gradientEndAngle = gaugeItem.endAngle;
  16733. var _data$i = data[i],
  16734. radius = _data$i.radius,
  16735. startAngle = _data$i.startAngle,
  16736. endAngle = _data$i.endAngle,
  16737. localGradient = _data$i.localGradient;
  16738. if (localGradient) gradientEndAngle = endAngle;
  16739. return {
  16740. rx: center[0],
  16741. ry: center[1],
  16742. r: radius,
  16743. startAngle: startAngle,
  16744. endAngle: endAngle,
  16745. gradientEndAngle: gradientEndAngle
  16746. };
  16747. }
  16748. function getGaugeArcStyle(gaugeItem, i) {
  16749. var data = gaugeItem.data,
  16750. dataItemStyle = gaugeItem.dataItemStyle;
  16751. var _data$i2 = data[i],
  16752. lineWidth = _data$i2.lineWidth,
  16753. gradient = _data$i2.gradient;
  16754. gradient = gradient.map(function (c) {
  16755. return (0, lib.getRgbaValue)(c);
  16756. });
  16757. return (0, util$1.deepMerge)({
  16758. lineWidth: lineWidth,
  16759. gradient: gradient
  16760. }, dataItemStyle);
  16761. }
  16762. function getStartArcConfig(gaugeItem) {
  16763. var configs = getArcConfig(gaugeItem);
  16764. configs.map(function (config) {
  16765. var shape = _objectSpread({}, config.shape);
  16766. shape.endAngle = config.shape.startAngle;
  16767. config.shape = shape;
  16768. });
  16769. return configs;
  16770. }
  16771. function beforeChangeArc(graph, config) {
  16772. var graphGradient = graph.style.gradient;
  16773. var cacheNum = graphGradient.length;
  16774. var needNum = config.style.gradient.length;
  16775. if (cacheNum > needNum) {
  16776. graphGradient.splice(needNum);
  16777. } else {
  16778. var last = graphGradient.slice(-1)[0];
  16779. graphGradient.push.apply(graphGradient, (0, _toConsumableArray2["default"])(new Array(needNum - cacheNum).fill(0).map(function (foo) {
  16780. return (0, _toConsumableArray2["default"])(last);
  16781. })));
  16782. }
  16783. }
  16784. function getPointerConfig(gaugeItem) {
  16785. var animationCurve = gaugeItem.animationCurve,
  16786. animationFrame = gaugeItem.animationFrame,
  16787. center = gaugeItem.center,
  16788. rLevel = gaugeItem.rLevel;
  16789. return [{
  16790. name: 'polyline',
  16791. index: rLevel,
  16792. visible: gaugeItem.pointer.show,
  16793. animationCurve: animationCurve,
  16794. animationFrame: animationFrame,
  16795. shape: getPointerShape(gaugeItem),
  16796. style: getPointerStyle(gaugeItem),
  16797. setGraphCenter: function setGraphCenter(foo, graph) {
  16798. graph.style.graphCenter = center;
  16799. }
  16800. }];
  16801. }
  16802. function getPointerShape(gaugeItem) {
  16803. var center = gaugeItem.center;
  16804. return {
  16805. points: getPointerPoints(center),
  16806. close: true
  16807. };
  16808. }
  16809. function getPointerStyle(gaugeItem) {
  16810. var startAngle = gaugeItem.startAngle,
  16811. endAngle = gaugeItem.endAngle,
  16812. min = gaugeItem.min,
  16813. max = gaugeItem.max,
  16814. data = gaugeItem.data,
  16815. pointer = gaugeItem.pointer,
  16816. center = gaugeItem.center;
  16817. var valueIndex = pointer.valueIndex,
  16818. style = pointer.style;
  16819. var value = data[valueIndex] ? data[valueIndex].value : 0;
  16820. var angle = (value - min) / (max - min) * (endAngle - startAngle) + startAngle + Math.PI / 2;
  16821. return (0, util$1.deepMerge)({
  16822. rotate: (0, util$1.radianToAngle)(angle),
  16823. scale: [1, 1],
  16824. graphCenter: center
  16825. }, style);
  16826. }
  16827. function getPointerPoints(_ref8) {
  16828. var _ref9 = (0, _slicedToArray2["default"])(_ref8, 2),
  16829. x = _ref9[0],
  16830. y = _ref9[1];
  16831. var point1 = [x, y - 40];
  16832. var point2 = [x + 5, y];
  16833. var point3 = [x, y + 10];
  16834. var point4 = [x - 5, y];
  16835. return [point1, point2, point3, point4];
  16836. }
  16837. function getStartPointerConfig(gaugeItem) {
  16838. var startAngle = gaugeItem.startAngle;
  16839. var config = getPointerConfig(gaugeItem)[0];
  16840. config.style.rotate = (0, util$1.radianToAngle)(startAngle + Math.PI / 2);
  16841. return [config];
  16842. }
  16843. function getDetailsConfig(gaugeItem) {
  16844. var detailsPosition = gaugeItem.detailsPosition,
  16845. animationCurve = gaugeItem.animationCurve,
  16846. animationFrame = gaugeItem.animationFrame,
  16847. rLevel = gaugeItem.rLevel;
  16848. var visible = gaugeItem.details.show;
  16849. return detailsPosition.map(function (foo, i) {
  16850. return {
  16851. name: 'numberText',
  16852. index: rLevel,
  16853. visible: visible,
  16854. animationCurve: animationCurve,
  16855. animationFrame: animationFrame,
  16856. shape: getDetailsShape(gaugeItem, i),
  16857. style: getDetailsStyle(gaugeItem, i)
  16858. };
  16859. });
  16860. }
  16861. function getDetailsShape(gaugeItem, i) {
  16862. var detailsPosition = gaugeItem.detailsPosition,
  16863. detailsContent = gaugeItem.detailsContent,
  16864. data = gaugeItem.data,
  16865. details = gaugeItem.details;
  16866. var position = detailsPosition[i];
  16867. var content = detailsContent[i];
  16868. var dataValue = data[i].value;
  16869. var toFixed = details.valueToFixed;
  16870. return {
  16871. number: [dataValue],
  16872. content: content,
  16873. position: position,
  16874. toFixed: toFixed
  16875. };
  16876. }
  16877. function getDetailsStyle(gaugeItem, i) {
  16878. var details = gaugeItem.details,
  16879. data = gaugeItem.data;
  16880. var style = details.style;
  16881. var color = data[i].color;
  16882. return (0, util$1.deepMerge)({
  16883. fill: color
  16884. }, style);
  16885. }
  16886. });
  16887. unwrapExports(gauge_1$1);
  16888. var gauge_2 = gauge_1$1.gauge;
  16889. var legend_1$1 = createCommonjsModule(function (module, exports) {
  16890. Object.defineProperty(exports, "__esModule", {
  16891. value: true
  16892. });
  16893. exports.legend = legend;
  16894. var _defineProperty2 = interopRequireDefault(defineProperty);
  16895. var _slicedToArray2 = interopRequireDefault(slicedToArray);
  16896. var _typeof2 = interopRequireDefault(_typeof_1);
  16897. function legend(chart) {
  16898. var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16899. var legend = option.legend;
  16900. if (legend) {
  16901. legend = (0, util$1.deepMerge)((0, util.deepClone)(config.legendConfig, true), legend);
  16902. legend = initLegendData(legend);
  16903. legend = filterInvalidData(legend, option, chart);
  16904. legend = calcLegendTextWidth(legend, chart);
  16905. legend = calcLegendPosition(legend, chart);
  16906. legend = [legend];
  16907. } else {
  16908. legend = [];
  16909. }
  16910. (0, updater_class.doUpdate)({
  16911. chart: chart,
  16912. series: legend,
  16913. key: 'legendIcon',
  16914. getGraphConfig: getIconConfig
  16915. });
  16916. (0, updater_class.doUpdate)({
  16917. chart: chart,
  16918. series: legend,
  16919. key: 'legendText',
  16920. getGraphConfig: getTextConfig
  16921. });
  16922. }
  16923. function initLegendData(legend) {
  16924. var data = legend.data;
  16925. legend.data = data.map(function (item) {
  16926. var itemType = (0, _typeof2["default"])(item);
  16927. if (itemType === 'string') {
  16928. return {
  16929. name: item
  16930. };
  16931. } else if (itemType === 'object') {
  16932. return item;
  16933. }
  16934. return {
  16935. name: ''
  16936. };
  16937. });
  16938. return legend;
  16939. }
  16940. function filterInvalidData(legend, option, chart) {
  16941. var series = option.series;
  16942. var legendStatus = chart.legendStatus;
  16943. var data = legend.data.filter(function (item) {
  16944. var name = item.name;
  16945. var result = series.find(function (_ref) {
  16946. var sn = _ref.name;
  16947. return name === sn;
  16948. });
  16949. if (!result) return false;
  16950. if (!item.color) item.color = result.color;
  16951. if (!item.icon) item.icon = result.type;
  16952. return item;
  16953. });
  16954. if (!legendStatus || legendStatus.length !== legend.data.length) legendStatus = new Array(legend.data.length).fill(true);
  16955. data.forEach(function (item, i) {
  16956. return item.status = legendStatus[i];
  16957. });
  16958. legend.data = data;
  16959. chart.legendStatus = legendStatus;
  16960. return legend;
  16961. }
  16962. function calcLegendTextWidth(legend, chart) {
  16963. var ctx = chart.render.ctx;
  16964. var data = legend.data,
  16965. textStyle = legend.textStyle,
  16966. textUnselectedStyle = legend.textUnselectedStyle;
  16967. data.forEach(function (item) {
  16968. var status = item.status,
  16969. name = item.name;
  16970. item.textWidth = getTextWidth(ctx, name, status ? textStyle : textUnselectedStyle);
  16971. });
  16972. return legend;
  16973. }
  16974. function getTextWidth(ctx, text, style) {
  16975. ctx.font = getFontConfig(style);
  16976. return ctx.measureText(text).width;
  16977. }
  16978. function getFontConfig(style) {
  16979. var fontFamily = style.fontFamily,
  16980. fontSize = style.fontSize;
  16981. return "".concat(fontSize, "px ").concat(fontFamily);
  16982. }
  16983. function calcLegendPosition(legend, chart) {
  16984. var orient = legend.orient;
  16985. if (orient === 'vertical') {
  16986. calcVerticalPosition(legend, chart);
  16987. } else {
  16988. calcHorizontalPosition(legend, chart);
  16989. }
  16990. return legend;
  16991. }
  16992. function calcHorizontalPosition(legend, chart) {
  16993. var iconHeight = legend.iconHeight,
  16994. itemGap = legend.itemGap;
  16995. var lines = calcDefaultHorizontalPosition(legend, chart);
  16996. var xOffsets = lines.map(function (line) {
  16997. return getHorizontalXOffset(line, legend, chart);
  16998. });
  16999. var yOffset = getHorizontalYOffset(legend, chart);
  17000. var align = {
  17001. textAlign: 'left',
  17002. textBaseline: 'middle'
  17003. };
  17004. lines.forEach(function (line, i) {
  17005. return line.forEach(function (item) {
  17006. var iconPosition = item.iconPosition,
  17007. textPosition = item.textPosition;
  17008. var xOffset = xOffsets[i];
  17009. var realYOffset = yOffset + i * (itemGap + iconHeight);
  17010. item.iconPosition = mergeOffset(iconPosition, [xOffset, realYOffset]);
  17011. item.textPosition = mergeOffset(textPosition, [xOffset, realYOffset]);
  17012. item.align = align;
  17013. });
  17014. });
  17015. }
  17016. function calcDefaultHorizontalPosition(legend, chart) {
  17017. var data = legend.data,
  17018. iconWidth = legend.iconWidth;
  17019. var w = chart.render.area[0];
  17020. var startIndex = 0;
  17021. var lines = [[]];
  17022. data.forEach(function (item, i) {
  17023. var beforeWidth = getBeforeWidth(startIndex, i, legend);
  17024. var endXPos = beforeWidth + iconWidth + 5 + item.textWidth;
  17025. if (endXPos >= w) {
  17026. startIndex = i;
  17027. beforeWidth = getBeforeWidth(startIndex, i, legend);
  17028. lines.push([]);
  17029. }
  17030. item.iconPosition = [beforeWidth, 0];
  17031. item.textPosition = [beforeWidth + iconWidth + 5, 0];
  17032. lines.slice(-1)[0].push(item);
  17033. });
  17034. return lines;
  17035. }
  17036. function getBeforeWidth(startIndex, currentIndex, legend) {
  17037. var data = legend.data,
  17038. iconWidth = legend.iconWidth,
  17039. itemGap = legend.itemGap;
  17040. var beforeItem = data.slice(startIndex, currentIndex);
  17041. return (0, util$1.mulAdd)(beforeItem.map(function (_ref2) {
  17042. var textWidth = _ref2.textWidth;
  17043. return textWidth;
  17044. })) + (currentIndex - startIndex) * (itemGap + 5 + iconWidth);
  17045. }
  17046. function getHorizontalXOffset(data, legend, chart) {
  17047. var left = legend.left,
  17048. right = legend.right,
  17049. iconWidth = legend.iconWidth,
  17050. itemGap = legend.itemGap;
  17051. var w = chart.render.area[0];
  17052. var dataNum = data.length;
  17053. var allWidth = (0, util$1.mulAdd)(data.map(function (_ref3) {
  17054. var textWidth = _ref3.textWidth;
  17055. return textWidth;
  17056. })) + dataNum * (5 + iconWidth) + (dataNum - 1) * itemGap;
  17057. var horizontal = [left, right].findIndex(function (pos) {
  17058. return pos !== 'auto';
  17059. });
  17060. if (horizontal === -1) {
  17061. return (w - allWidth) / 2;
  17062. } else if (horizontal === 0) {
  17063. if (typeof left === 'number') return left;
  17064. return parseInt(left) / 100 * w;
  17065. } else {
  17066. if (typeof right !== 'number') right = parseInt(right) / 100 * w;
  17067. return w - (allWidth + right);
  17068. }
  17069. }
  17070. function getHorizontalYOffset(legend, chart) {
  17071. var top = legend.top,
  17072. bottom = legend.bottom,
  17073. iconHeight = legend.iconHeight;
  17074. var h = chart.render.area[1];
  17075. var vertical = [top, bottom].findIndex(function (pos) {
  17076. return pos !== 'auto';
  17077. });
  17078. var halfIconHeight = iconHeight / 2;
  17079. if (vertical === -1) {
  17080. var _chart$gridArea = chart.gridArea,
  17081. y = _chart$gridArea.y,
  17082. height = _chart$gridArea.h;
  17083. return y + height + 45 - halfIconHeight;
  17084. } else if (vertical === 0) {
  17085. if (typeof top === 'number') return top - halfIconHeight;
  17086. return parseInt(top) / 100 * h - halfIconHeight;
  17087. } else {
  17088. if (typeof bottom !== 'number') bottom = parseInt(bottom) / 100 * h;
  17089. return h - bottom - halfIconHeight;
  17090. }
  17091. }
  17092. function mergeOffset(_ref4, _ref5) {
  17093. var _ref6 = (0, _slicedToArray2["default"])(_ref4, 2),
  17094. x = _ref6[0],
  17095. y = _ref6[1];
  17096. var _ref7 = (0, _slicedToArray2["default"])(_ref5, 2),
  17097. ox = _ref7[0],
  17098. oy = _ref7[1];
  17099. return [x + ox, y + oy];
  17100. }
  17101. function calcVerticalPosition(legend, chart) {
  17102. var _getVerticalXOffset = getVerticalXOffset(legend, chart),
  17103. _getVerticalXOffset2 = (0, _slicedToArray2["default"])(_getVerticalXOffset, 2),
  17104. isRight = _getVerticalXOffset2[0],
  17105. xOffset = _getVerticalXOffset2[1];
  17106. var yOffset = getVerticalYOffset(legend, chart);
  17107. calcDefaultVerticalPosition(legend, isRight);
  17108. var align = {
  17109. textAlign: 'left',
  17110. textBaseline: 'middle'
  17111. };
  17112. legend.data.forEach(function (item) {
  17113. var textPosition = item.textPosition,
  17114. iconPosition = item.iconPosition;
  17115. item.textPosition = mergeOffset(textPosition, [xOffset, yOffset]);
  17116. item.iconPosition = mergeOffset(iconPosition, [xOffset, yOffset]);
  17117. item.align = align;
  17118. });
  17119. }
  17120. function getVerticalXOffset(legend, chart) {
  17121. var left = legend.left,
  17122. right = legend.right;
  17123. var w = chart.render.area[0];
  17124. var horizontal = [left, right].findIndex(function (pos) {
  17125. return pos !== 'auto';
  17126. });
  17127. if (horizontal === -1) {
  17128. return [true, w - 10];
  17129. } else {
  17130. var offset = [left, right][horizontal];
  17131. if (typeof offset !== 'number') offset = parseInt(offset) / 100 * w;
  17132. return [Boolean(horizontal), offset];
  17133. }
  17134. }
  17135. function getVerticalYOffset(legend, chart) {
  17136. var iconHeight = legend.iconHeight,
  17137. itemGap = legend.itemGap,
  17138. data = legend.data,
  17139. top = legend.top,
  17140. bottom = legend.bottom;
  17141. var h = chart.render.area[1];
  17142. var dataNum = data.length;
  17143. var allHeight = dataNum * iconHeight + (dataNum - 1) * itemGap;
  17144. var vertical = [top, bottom].findIndex(function (pos) {
  17145. return pos !== 'auto';
  17146. });
  17147. if (vertical === -1) {
  17148. return (h - allHeight) / 2;
  17149. } else {
  17150. var offset = [top, bottom][vertical];
  17151. if (typeof offset !== 'number') offset = parseInt(offset) / 100 * h;
  17152. if (vertical === 1) offset = h - offset - allHeight;
  17153. return offset;
  17154. }
  17155. }
  17156. function calcDefaultVerticalPosition(legend, isRight) {
  17157. var data = legend.data,
  17158. iconWidth = legend.iconWidth,
  17159. iconHeight = legend.iconHeight,
  17160. itemGap = legend.itemGap;
  17161. var halfIconHeight = iconHeight / 2;
  17162. data.forEach(function (item, i) {
  17163. var textWidth = item.textWidth;
  17164. var yPos = (iconHeight + itemGap) * i + halfIconHeight;
  17165. var iconXPos = isRight ? 0 - iconWidth : 0;
  17166. var textXpos = isRight ? iconXPos - 5 - textWidth : iconWidth + 5;
  17167. item.iconPosition = [iconXPos, yPos];
  17168. item.textPosition = [textXpos, yPos];
  17169. });
  17170. }
  17171. function getIconConfig(legendItem, updater) {
  17172. var data = legendItem.data,
  17173. selectAble = legendItem.selectAble,
  17174. animationCurve = legendItem.animationCurve,
  17175. animationFrame = legendItem.animationFrame,
  17176. rLevel = legendItem.rLevel;
  17177. return data.map(function (item, i) {
  17178. return (0, _defineProperty2["default"])({
  17179. name: item.icon === 'line' ? 'lineIcon' : 'rect',
  17180. index: rLevel,
  17181. visible: legendItem.show,
  17182. hover: selectAble,
  17183. click: selectAble,
  17184. animationCurve: animationCurve,
  17185. animationFrame: animationFrame,
  17186. shape: getIconShape(legendItem, i),
  17187. style: getIconStyle(legendItem, i)
  17188. }, "click", createClickCallBack(legendItem, i, updater));
  17189. });
  17190. }
  17191. function getIconShape(legendItem, i) {
  17192. var data = legendItem.data,
  17193. iconWidth = legendItem.iconWidth,
  17194. iconHeight = legendItem.iconHeight;
  17195. var _data$i$iconPosition = (0, _slicedToArray2["default"])(data[i].iconPosition, 2),
  17196. x = _data$i$iconPosition[0],
  17197. y = _data$i$iconPosition[1];
  17198. var halfIconHeight = iconHeight / 2;
  17199. return {
  17200. x: x,
  17201. y: y - halfIconHeight,
  17202. w: iconWidth,
  17203. h: iconHeight
  17204. };
  17205. }
  17206. function getIconStyle(legendItem, i) {
  17207. var data = legendItem.data,
  17208. iconStyle = legendItem.iconStyle,
  17209. iconUnselectedStyle = legendItem.iconUnselectedStyle;
  17210. var _data$i = data[i],
  17211. status = _data$i.status,
  17212. color = _data$i.color;
  17213. var style = status ? iconStyle : iconUnselectedStyle;
  17214. return (0, util$1.deepMerge)({
  17215. fill: color
  17216. }, style);
  17217. }
  17218. function getTextConfig(legendItem, updater) {
  17219. var data = legendItem.data,
  17220. selectAble = legendItem.selectAble,
  17221. animationCurve = legendItem.animationCurve,
  17222. animationFrame = legendItem.animationFrame,
  17223. rLevel = legendItem.rLevel;
  17224. return data.map(function (foo, i) {
  17225. return {
  17226. name: 'text',
  17227. index: rLevel,
  17228. visible: legendItem.show,
  17229. hover: selectAble,
  17230. animationCurve: animationCurve,
  17231. animationFrame: animationFrame,
  17232. hoverRect: getTextHoverRect(legendItem, i),
  17233. shape: getTextShape(legendItem, i),
  17234. style: getTextStyle(legendItem, i),
  17235. click: createClickCallBack(legendItem, i, updater)
  17236. };
  17237. });
  17238. }
  17239. function getTextShape(legendItem, i) {
  17240. var _legendItem$data$i = legendItem.data[i],
  17241. textPosition = _legendItem$data$i.textPosition,
  17242. name = _legendItem$data$i.name;
  17243. return {
  17244. content: name,
  17245. position: textPosition
  17246. };
  17247. }
  17248. function getTextStyle(legendItem, i) {
  17249. var textStyle = legendItem.textStyle,
  17250. textUnselectedStyle = legendItem.textUnselectedStyle;
  17251. var _legendItem$data$i2 = legendItem.data[i],
  17252. status = _legendItem$data$i2.status,
  17253. align = _legendItem$data$i2.align;
  17254. var style = status ? textStyle : textUnselectedStyle;
  17255. return (0, util$1.deepMerge)((0, util.deepClone)(style, true), align);
  17256. }
  17257. function getTextHoverRect(legendItem, i) {
  17258. var textStyle = legendItem.textStyle,
  17259. textUnselectedStyle = legendItem.textUnselectedStyle;
  17260. var _legendItem$data$i3 = legendItem.data[i],
  17261. status = _legendItem$data$i3.status,
  17262. _legendItem$data$i3$t = (0, _slicedToArray2["default"])(_legendItem$data$i3.textPosition, 2),
  17263. x = _legendItem$data$i3$t[0],
  17264. y = _legendItem$data$i3$t[1],
  17265. textWidth = _legendItem$data$i3.textWidth;
  17266. var style = status ? textStyle : textUnselectedStyle;
  17267. var fontSize = style.fontSize;
  17268. return [x, y - fontSize / 2, textWidth, fontSize];
  17269. }
  17270. function createClickCallBack(legendItem, index, updater) {
  17271. var name = legendItem.data[index].name;
  17272. return function () {
  17273. var _updater$chart = updater.chart,
  17274. legendStatus = _updater$chart.legendStatus,
  17275. option = _updater$chart.option;
  17276. var status = !legendStatus[index];
  17277. var change = option.series.find(function (_ref9) {
  17278. var sn = _ref9.name;
  17279. return sn === name;
  17280. });
  17281. change.show = status;
  17282. legendStatus[index] = status;
  17283. updater.chart.setOption(option);
  17284. };
  17285. }
  17286. });
  17287. unwrapExports(legend_1$1);
  17288. var legend_2 = legend_1$1.legend;
  17289. var core = createCommonjsModule(function (module, exports) {
  17290. Object.defineProperty(exports, "__esModule", {
  17291. value: true
  17292. });
  17293. Object.defineProperty(exports, "mergeColor", {
  17294. enumerable: true,
  17295. get: function get() {
  17296. return mergeColor_1.mergeColor;
  17297. }
  17298. });
  17299. Object.defineProperty(exports, "title", {
  17300. enumerable: true,
  17301. get: function get() {
  17302. return title_1$1.title;
  17303. }
  17304. });
  17305. Object.defineProperty(exports, "grid", {
  17306. enumerable: true,
  17307. get: function get() {
  17308. return grid_1$1.grid;
  17309. }
  17310. });
  17311. Object.defineProperty(exports, "axis", {
  17312. enumerable: true,
  17313. get: function get() {
  17314. return axis_1$1.axis;
  17315. }
  17316. });
  17317. Object.defineProperty(exports, "line", {
  17318. enumerable: true,
  17319. get: function get() {
  17320. return line_1$1.line;
  17321. }
  17322. });
  17323. Object.defineProperty(exports, "bar", {
  17324. enumerable: true,
  17325. get: function get() {
  17326. return bar_1$1.bar;
  17327. }
  17328. });
  17329. Object.defineProperty(exports, "pie", {
  17330. enumerable: true,
  17331. get: function get() {
  17332. return pie_1$1.pie;
  17333. }
  17334. });
  17335. Object.defineProperty(exports, "radarAxis", {
  17336. enumerable: true,
  17337. get: function get() {
  17338. return radarAxis_1$1.radarAxis;
  17339. }
  17340. });
  17341. Object.defineProperty(exports, "radar", {
  17342. enumerable: true,
  17343. get: function get() {
  17344. return radar_1$1.radar;
  17345. }
  17346. });
  17347. Object.defineProperty(exports, "gauge", {
  17348. enumerable: true,
  17349. get: function get() {
  17350. return gauge_1$1.gauge;
  17351. }
  17352. });
  17353. Object.defineProperty(exports, "legend", {
  17354. enumerable: true,
  17355. get: function get() {
  17356. return legend_1$1.legend;
  17357. }
  17358. });
  17359. });
  17360. unwrapExports(core);
  17361. var charts_class = createCommonjsModule(function (module, exports) {
  17362. Object.defineProperty(exports, "__esModule", {
  17363. value: true
  17364. });
  17365. exports["default"] = void 0;
  17366. var _typeof2 = interopRequireDefault(_typeof_1);
  17367. var _classCallCheck2 = interopRequireDefault(classCallCheck);
  17368. var _cRender = interopRequireDefault(lib$3);
  17369. var Charts = function Charts(dom) {
  17370. (0, _classCallCheck2["default"])(this, Charts);
  17371. if (!dom) {
  17372. console.error('Charts Missing parameters!');
  17373. return false;
  17374. }
  17375. var clientWidth = dom.clientWidth,
  17376. clientHeight = dom.clientHeight;
  17377. var canvas = document.createElement('canvas');
  17378. canvas.setAttribute('width', clientWidth);
  17379. canvas.setAttribute('height', clientHeight);
  17380. dom.appendChild(canvas);
  17381. var attribute = {
  17382. container: dom,
  17383. canvas: canvas,
  17384. render: new _cRender["default"](canvas),
  17385. option: null
  17386. };
  17387. Object.assign(this, attribute);
  17388. };
  17389. /**
  17390. * @description Set chart option
  17391. * @param {Object} option Chart option
  17392. * @param {Boolean} animationEnd Execute animationEnd
  17393. * @return {Undefined} No return
  17394. */
  17395. exports["default"] = Charts;
  17396. Charts.prototype.setOption = function (option) {
  17397. var animationEnd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  17398. if (!option || (0, _typeof2["default"])(option) !== 'object') {
  17399. console.error('setOption Missing parameters!');
  17400. return false;
  17401. }
  17402. if (animationEnd) this.render.graphs.forEach(function (graph) {
  17403. return graph.animationEnd();
  17404. });
  17405. var optionCloned = (0, util.deepClone)(option, true);
  17406. (0, core.mergeColor)(this, optionCloned);
  17407. (0, core.grid)(this, optionCloned);
  17408. (0, core.axis)(this, optionCloned);
  17409. (0, core.radarAxis)(this, optionCloned);
  17410. (0, core.title)(this, optionCloned);
  17411. (0, core.bar)(this, optionCloned);
  17412. (0, core.line)(this, optionCloned);
  17413. (0, core.pie)(this, optionCloned);
  17414. (0, core.radar)(this, optionCloned);
  17415. (0, core.gauge)(this, optionCloned);
  17416. (0, core.legend)(this, optionCloned);
  17417. this.option = option;
  17418. this.render.launchAnimation(); // console.warn(this)
  17419. };
  17420. /**
  17421. * @description Resize chart
  17422. * @return {Undefined} No return
  17423. */
  17424. Charts.prototype.resize = function () {
  17425. var container = this.container,
  17426. canvas = this.canvas,
  17427. render = this.render,
  17428. option = this.option;
  17429. var clientWidth = container.clientWidth,
  17430. clientHeight = container.clientHeight;
  17431. canvas.setAttribute('width', clientWidth);
  17432. canvas.setAttribute('height', clientHeight);
  17433. render.area = [clientWidth, clientHeight];
  17434. this.setOption(option);
  17435. };
  17436. });
  17437. unwrapExports(charts_class);
  17438. var lib$4 = createCommonjsModule(function (module, exports) {
  17439. Object.defineProperty(exports, "__esModule", {
  17440. value: true
  17441. });
  17442. Object.defineProperty(exports, "changeDefaultConfig", {
  17443. enumerable: true,
  17444. get: function get() {
  17445. return config.changeDefaultConfig;
  17446. }
  17447. });
  17448. exports["default"] = void 0;
  17449. var _charts = interopRequireDefault(charts_class);
  17450. var _default = _charts["default"];
  17451. exports["default"] = _default;
  17452. });
  17453. var Charts = unwrapExports(lib$4);
  17454. //
  17455. var script$r = {
  17456. name: 'DvCharts',
  17457. mixins: [autoResize],
  17458. props: {
  17459. option: {
  17460. type: Object,
  17461. default: () => ({})
  17462. }
  17463. },
  17464. data() {
  17465. const id = uuid();
  17466. return {
  17467. ref: `charts-container-${id}`,
  17468. chartRef: `chart-${id}`,
  17469. chart: null
  17470. };
  17471. },
  17472. watch: {
  17473. option() {
  17474. let {
  17475. chart,
  17476. option
  17477. } = this;
  17478. if (!chart) return;
  17479. if (!option) option = {};
  17480. chart.setOption(option, true);
  17481. }
  17482. },
  17483. methods: {
  17484. afterAutoResizeMixinInit() {
  17485. const {
  17486. initChart
  17487. } = this;
  17488. initChart();
  17489. },
  17490. initChart() {
  17491. const {
  17492. $refs,
  17493. chartRef,
  17494. option
  17495. } = this;
  17496. const chart = this.chart = new Charts($refs[chartRef]);
  17497. if (!option) return;
  17498. chart.setOption(option);
  17499. },
  17500. onResize() {
  17501. const {
  17502. chart
  17503. } = this;
  17504. if (!chart) return;
  17505. chart.resize();
  17506. }
  17507. }
  17508. };
  17509. /* script */
  17510. const __vue_script__$r = script$r;
  17511. /* template */
  17512. var __vue_render__$r = function() {
  17513. var _vm = this;
  17514. var _h = _vm.$createElement;
  17515. var _c = _vm._self._c || _h;
  17516. return _c("div", { ref: _vm.ref, staticClass: "dv-charts-container" }, [
  17517. _c("div", { ref: _vm.chartRef, staticClass: "charts-canvas-container" })
  17518. ])
  17519. };
  17520. var __vue_staticRenderFns__$r = [];
  17521. __vue_render__$r._withStripped = true;
  17522. /* style */
  17523. const __vue_inject_styles__$r = function (inject) {
  17524. if (!inject) return
  17525. inject("data-v-1f446fe6_0", { source: ".dv-charts-container {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-charts-container .charts-canvas-container {\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;AACA;EACE,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-charts-container {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.dv-charts-container .charts-canvas-container {\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  17526. };
  17527. /* scoped */
  17528. const __vue_scope_id__$r = undefined;
  17529. /* module identifier */
  17530. const __vue_module_identifier__$r = undefined;
  17531. /* functional template */
  17532. const __vue_is_functional_template__$r = false;
  17533. /* style inject SSR */
  17534. /* style inject shadow dom */
  17535. const __vue_component__$r = /*#__PURE__*/normalizeComponent(
  17536. { render: __vue_render__$r, staticRenderFns: __vue_staticRenderFns__$r },
  17537. __vue_inject_styles__$r,
  17538. __vue_script__$r,
  17539. __vue_scope_id__$r,
  17540. __vue_is_functional_template__$r,
  17541. __vue_module_identifier__$r,
  17542. false,
  17543. createInjector,
  17544. undefined,
  17545. undefined
  17546. );
  17547. function charts (Vue) {
  17548. Vue.component(__vue_component__$r.name, __vue_component__$r);
  17549. }
  17550. //
  17551. var script$s = {
  17552. name: 'DvDigitalFlop',
  17553. props: {
  17554. config: {
  17555. type: Object,
  17556. default: () => ({})
  17557. }
  17558. },
  17559. data() {
  17560. return {
  17561. renderer: null,
  17562. defaultConfig: {
  17563. /**
  17564. * @description Number for digital flop
  17565. * @type {Array<Number>}
  17566. * @default number = []
  17567. * @example number = [10]
  17568. */
  17569. number: [],
  17570. /**
  17571. * @description Content formatter
  17572. * @type {String}
  17573. * @default content = ''
  17574. * @example content = '{nt}个'
  17575. */
  17576. content: '',
  17577. /**
  17578. * @description Number toFixed
  17579. * @type {Number}
  17580. * @default toFixed = 0
  17581. */
  17582. toFixed: 0,
  17583. /**
  17584. * @description Text align
  17585. * @type {String}
  17586. * @default textAlign = 'center'
  17587. * @example textAlign = 'center' | 'left' | 'right'
  17588. */
  17589. textAlign: 'center',
  17590. /**
  17591. * @description rowGap
  17592. * @type {Number}
  17593. @default rowGap = 0
  17594. */
  17595. rowGap: 0,
  17596. /**
  17597. * @description Text style configuration
  17598. * @type {Object} {CRender Class Style}
  17599. */
  17600. style: {
  17601. fontSize: 30,
  17602. fill: '#3de7c9'
  17603. },
  17604. /**
  17605. * @description Number formatter
  17606. * @type {Null|Function}
  17607. */
  17608. formatter: undefined,
  17609. /**
  17610. * @description CRender animationCurve
  17611. * @type {String}
  17612. * @default animationCurve = 'easeOutCubic'
  17613. */
  17614. animationCurve: 'easeOutCubic',
  17615. /**
  17616. * @description CRender animationFrame
  17617. * @type {String}
  17618. * @default animationFrame = 50
  17619. */
  17620. animationFrame: 50
  17621. },
  17622. mergedConfig: null,
  17623. graph: null
  17624. };
  17625. },
  17626. watch: {
  17627. config() {
  17628. const {
  17629. update
  17630. } = this;
  17631. update();
  17632. }
  17633. },
  17634. methods: {
  17635. init() {
  17636. const {
  17637. initRender,
  17638. mergeConfig,
  17639. initGraph
  17640. } = this;
  17641. initRender();
  17642. mergeConfig();
  17643. initGraph();
  17644. },
  17645. initRender() {
  17646. const {
  17647. $refs
  17648. } = this;
  17649. this.renderer = new CRender($refs['digital-flop']);
  17650. },
  17651. mergeConfig() {
  17652. const {
  17653. defaultConfig,
  17654. config
  17655. } = this;
  17656. this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
  17657. },
  17658. initGraph() {
  17659. const {
  17660. getShape,
  17661. getStyle,
  17662. renderer,
  17663. mergedConfig
  17664. } = this;
  17665. const {
  17666. animationCurve,
  17667. animationFrame
  17668. } = mergedConfig;
  17669. const shape = getShape();
  17670. const style = getStyle();
  17671. this.graph = renderer.add({
  17672. name: 'numberText',
  17673. animationCurve,
  17674. animationFrame,
  17675. shape,
  17676. style
  17677. });
  17678. },
  17679. getShape() {
  17680. const {
  17681. number,
  17682. content,
  17683. toFixed,
  17684. textAlign,
  17685. rowGap,
  17686. formatter
  17687. } = this.mergedConfig;
  17688. const [w, h] = this.renderer.area;
  17689. const position = [w / 2, h / 2];
  17690. if (textAlign === 'left') position[0] = 0;
  17691. if (textAlign === 'right') position[0] = w;
  17692. return {
  17693. number,
  17694. content,
  17695. toFixed,
  17696. position,
  17697. rowGap,
  17698. formatter
  17699. };
  17700. },
  17701. getStyle() {
  17702. const {
  17703. style,
  17704. textAlign
  17705. } = this.mergedConfig;
  17706. return util_2$1(style, {
  17707. textAlign,
  17708. textBaseline: 'middle'
  17709. });
  17710. },
  17711. update() {
  17712. const {
  17713. mergeConfig,
  17714. mergeShape,
  17715. getShape,
  17716. getStyle,
  17717. graph,
  17718. mergedConfig
  17719. } = this;
  17720. graph.animationEnd();
  17721. mergeConfig();
  17722. if (!graph) return;
  17723. const {
  17724. animationCurve,
  17725. animationFrame
  17726. } = mergedConfig;
  17727. const shape = getShape();
  17728. const style = getStyle();
  17729. mergeShape(graph, shape);
  17730. graph.animationCurve = animationCurve;
  17731. graph.animationFrame = animationFrame;
  17732. graph.animation('style', style, true);
  17733. graph.animation('shape', shape);
  17734. },
  17735. mergeShape(graph, shape) {
  17736. const cacheNum = graph.shape.number.length;
  17737. const shapeNum = shape.number.length;
  17738. if (cacheNum !== shapeNum) graph.shape.number = shape.number;
  17739. }
  17740. },
  17741. mounted() {
  17742. const {
  17743. init
  17744. } = this;
  17745. init();
  17746. }
  17747. };
  17748. /* script */
  17749. const __vue_script__$s = script$s;
  17750. /* template */
  17751. var __vue_render__$s = function() {
  17752. var _vm = this;
  17753. var _h = _vm.$createElement;
  17754. var _c = _vm._self._c || _h;
  17755. return _c("div", { staticClass: "dv-digital-flop" }, [
  17756. _c("canvas", { ref: "digital-flop" })
  17757. ])
  17758. };
  17759. var __vue_staticRenderFns__$s = [];
  17760. __vue_render__$s._withStripped = true;
  17761. /* style */
  17762. const __vue_inject_styles__$s = function (inject) {
  17763. if (!inject) return
  17764. inject("data-v-113591fb_0", { source: ".dv-digital-flop canvas {\n width: 100%;\n height: 100%;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd","file":"main.vue","sourcesContent":[".dv-digital-flop canvas {\n width: 100%;\n height: 100%;\n}\n"]}, media: undefined });
  17765. };
  17766. /* scoped */
  17767. const __vue_scope_id__$s = undefined;
  17768. /* module identifier */
  17769. const __vue_module_identifier__$s = undefined;
  17770. /* functional template */
  17771. const __vue_is_functional_template__$s = false;
  17772. /* style inject SSR */
  17773. /* style inject shadow dom */
  17774. const __vue_component__$s = /*#__PURE__*/normalizeComponent(
  17775. { render: __vue_render__$s, staticRenderFns: __vue_staticRenderFns__$s },
  17776. __vue_inject_styles__$s,
  17777. __vue_script__$s,
  17778. __vue_scope_id__$s,
  17779. __vue_is_functional_template__$s,
  17780. __vue_module_identifier__$s,
  17781. false,
  17782. createInjector,
  17783. undefined,
  17784. undefined
  17785. );
  17786. //
  17787. var script$t = {
  17788. name: 'DvActiveRingChart',
  17789. components: {
  17790. dvDigitalFlop: __vue_component__$s
  17791. },
  17792. props: {
  17793. config: {
  17794. type: Object,
  17795. default: () => ({})
  17796. }
  17797. },
  17798. data() {
  17799. return {
  17800. defaultConfig: {
  17801. /**
  17802. * @description Ring radius
  17803. * @type {String|Number}
  17804. * @default radius = '50%'
  17805. * @example radius = '50%' | 100
  17806. */
  17807. radius: '50%',
  17808. /**
  17809. * @description Active ring radius
  17810. * @type {String|Number}
  17811. * @default activeRadius = '55%'
  17812. * @example activeRadius = '55%' | 110
  17813. */
  17814. activeRadius: '55%',
  17815. /**
  17816. * @description Ring data
  17817. * @type {Array<Object>}
  17818. * @default data = [{ name: '', value: 0 }]
  17819. */
  17820. data: [{
  17821. name: '',
  17822. value: 0
  17823. }],
  17824. /**
  17825. * @description Ring line width
  17826. * @type {Number}
  17827. * @default lineWidth = 20
  17828. */
  17829. lineWidth: 20,
  17830. /**
  17831. * @description Active time gap (ms)
  17832. * @type {Number}
  17833. * @default activeTimeGap = 3000
  17834. */
  17835. activeTimeGap: 3000,
  17836. /**
  17837. * @description Ring color (hex|rgb|rgba|color keywords)
  17838. * @type {Array<String>}
  17839. * @default color = [Charts Default Color]
  17840. * @example color = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red']
  17841. */
  17842. color: [],
  17843. /**
  17844. * @description Digital flop style
  17845. * @type {Object}
  17846. */
  17847. digitalFlopStyle: {
  17848. fontSize: 25,
  17849. fill: '#fff'
  17850. },
  17851. /**
  17852. * @description Digital flop toFixed
  17853. * @type {Number}
  17854. */
  17855. digitalFlopToFixed: 0,
  17856. /**
  17857. * @description Digital flop unit
  17858. * @type {String}
  17859. */
  17860. digitalFlopUnit: '',
  17861. /**
  17862. * @description CRender animationCurve
  17863. * @type {String}
  17864. * @default animationCurve = 'easeOutCubic'
  17865. */
  17866. animationCurve: 'easeOutCubic',
  17867. /**
  17868. * @description CRender animationFrame
  17869. * @type {String}
  17870. * @default animationFrame = 50
  17871. */
  17872. animationFrame: 50,
  17873. /**
  17874. * @description showOriginValue
  17875. * @type {Boolean}
  17876. * @default showOriginValue = false
  17877. */
  17878. showOriginValue: false
  17879. },
  17880. mergedConfig: null,
  17881. chart: null,
  17882. activeIndex: 0,
  17883. animationHandler: ''
  17884. };
  17885. },
  17886. computed: {
  17887. digitalFlop() {
  17888. const {
  17889. mergedConfig,
  17890. activeIndex
  17891. } = this;
  17892. if (!mergedConfig) return {};
  17893. const {
  17894. digitalFlopStyle,
  17895. digitalFlopToFixed,
  17896. data,
  17897. showOriginValue,
  17898. digitalFlopUnit
  17899. } = mergedConfig;
  17900. const value = data.map(({
  17901. value
  17902. }) => value);
  17903. let displayValue;
  17904. if (showOriginValue) {
  17905. displayValue = value[activeIndex];
  17906. } else {
  17907. const sum = value.reduce((all, v) => all + v, 0);
  17908. const percent = parseFloat(value[activeIndex] / sum * 100) || 0;
  17909. displayValue = percent;
  17910. }
  17911. return {
  17912. content: showOriginValue ? `{nt}${digitalFlopUnit}` : `{nt}${digitalFlopUnit || '%'}`,
  17913. number: [displayValue],
  17914. style: digitalFlopStyle,
  17915. toFixed: digitalFlopToFixed
  17916. };
  17917. },
  17918. ringName() {
  17919. const {
  17920. mergedConfig,
  17921. activeIndex
  17922. } = this;
  17923. if (!mergedConfig) return '';
  17924. return mergedConfig.data[activeIndex].name;
  17925. },
  17926. fontSize() {
  17927. const {
  17928. mergedConfig
  17929. } = this;
  17930. if (!mergedConfig) return '';
  17931. return `font-size: ${mergedConfig.digitalFlopStyle.fontSize}px;`;
  17932. }
  17933. },
  17934. watch: {
  17935. config() {
  17936. const {
  17937. animationHandler,
  17938. mergeConfig,
  17939. setRingOption
  17940. } = this;
  17941. clearTimeout(animationHandler);
  17942. this.activeIndex = 0;
  17943. mergeConfig();
  17944. setRingOption();
  17945. }
  17946. },
  17947. methods: {
  17948. init() {
  17949. const {
  17950. initChart,
  17951. mergeConfig,
  17952. setRingOption
  17953. } = this;
  17954. initChart();
  17955. mergeConfig();
  17956. setRingOption();
  17957. },
  17958. initChart() {
  17959. const {
  17960. $refs
  17961. } = this;
  17962. this.chart = new Charts($refs['active-ring-chart']);
  17963. },
  17964. mergeConfig() {
  17965. const {
  17966. defaultConfig,
  17967. config
  17968. } = this;
  17969. this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
  17970. },
  17971. setRingOption() {
  17972. const {
  17973. getRingOption,
  17974. chart,
  17975. ringAnimation
  17976. } = this;
  17977. const option = getRingOption();
  17978. chart.setOption(option, true);
  17979. ringAnimation();
  17980. },
  17981. getRingOption() {
  17982. const {
  17983. mergedConfig,
  17984. getRealRadius
  17985. } = this;
  17986. const radius = getRealRadius();
  17987. mergedConfig.data.forEach(dataItem => {
  17988. dataItem.radius = radius;
  17989. });
  17990. return {
  17991. series: [{
  17992. type: 'pie',
  17993. ...mergedConfig,
  17994. outsideLabel: {
  17995. show: false
  17996. }
  17997. }],
  17998. color: mergedConfig.color
  17999. };
  18000. },
  18001. getRealRadius(active = false) {
  18002. const {
  18003. mergedConfig,
  18004. chart
  18005. } = this;
  18006. const {
  18007. radius,
  18008. activeRadius,
  18009. lineWidth
  18010. } = mergedConfig;
  18011. const maxRadius = Math.min(...chart.render.area) / 2;
  18012. const halfLineWidth = lineWidth / 2;
  18013. let realRadius = active ? activeRadius : radius;
  18014. if (typeof realRadius !== 'number') realRadius = parseInt(realRadius) / 100 * maxRadius;
  18015. const insideRadius = realRadius - halfLineWidth;
  18016. const outSideRadius = realRadius + halfLineWidth;
  18017. return [insideRadius, outSideRadius];
  18018. },
  18019. ringAnimation() {
  18020. let {
  18021. activeIndex,
  18022. getRingOption,
  18023. chart,
  18024. getRealRadius
  18025. } = this;
  18026. const radius = getRealRadius();
  18027. const active = getRealRadius(true);
  18028. const option = getRingOption();
  18029. const {
  18030. data
  18031. } = option.series[0];
  18032. data.forEach((dataItem, i) => {
  18033. if (i === activeIndex) {
  18034. dataItem.radius = active;
  18035. } else {
  18036. dataItem.radius = radius;
  18037. }
  18038. });
  18039. chart.setOption(option, true);
  18040. const {
  18041. activeTimeGap
  18042. } = option.series[0];
  18043. this.animationHandler = setTimeout(foo => {
  18044. activeIndex += 1;
  18045. if (activeIndex >= data.length) activeIndex = 0;
  18046. this.activeIndex = activeIndex;
  18047. this.ringAnimation();
  18048. }, activeTimeGap);
  18049. }
  18050. },
  18051. mounted() {
  18052. const {
  18053. init
  18054. } = this;
  18055. init();
  18056. },
  18057. beforeDestroy() {
  18058. const {
  18059. animationHandler
  18060. } = this;
  18061. clearTimeout(animationHandler);
  18062. }
  18063. };
  18064. /* script */
  18065. const __vue_script__$t = script$t;
  18066. /* template */
  18067. var __vue_render__$t = function() {
  18068. var _vm = this;
  18069. var _h = _vm.$createElement;
  18070. var _c = _vm._self._c || _h;
  18071. return _c("div", { staticClass: "dv-active-ring-chart" }, [
  18072. _c("div", {
  18073. ref: "active-ring-chart",
  18074. staticClass: "active-ring-chart-container"
  18075. }),
  18076. _vm._v(" "),
  18077. _c(
  18078. "div",
  18079. { staticClass: "active-ring-info" },
  18080. [
  18081. _c("dv-digital-flop", { attrs: { config: _vm.digitalFlop } }),
  18082. _vm._v(" "),
  18083. _c("div", { staticClass: "active-ring-name", style: _vm.fontSize }, [
  18084. _vm._v(_vm._s(_vm.ringName))
  18085. ])
  18086. ],
  18087. 1
  18088. )
  18089. ])
  18090. };
  18091. var __vue_staticRenderFns__$t = [];
  18092. __vue_render__$t._withStripped = true;
  18093. /* style */
  18094. const __vue_inject_styles__$t = function (inject) {
  18095. if (!inject) return
  18096. inject("data-v-ca8abc0a_0", { source: ".dv-active-ring-chart {\n position: relative;\n}\n.dv-active-ring-chart .active-ring-chart-container {\n width: 100%;\n height: 100%;\n}\n.dv-active-ring-chart .active-ring-info {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n.dv-active-ring-chart .active-ring-info .dv-digital-flop {\n width: 100px;\n height: 30px;\n}\n.dv-active-ring-chart .active-ring-info .active-ring-name {\n width: 100px;\n height: 30px;\n color: #fff;\n text-align: center;\n vertical-align: middle;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;AACpB;AACA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,SAAS;EACT,QAAQ;EACR,aAAa;EACb,sBAAsB;EACtB,uBAAuB;EACvB,mBAAmB;AACrB;AACA;EACE,YAAY;EACZ,YAAY;AACd;AACA;EACE,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,kBAAkB;EAClB,sBAAsB;EACtB,uBAAuB;EACvB,gBAAgB;EAChB,mBAAmB;AACrB","file":"main.vue","sourcesContent":[".dv-active-ring-chart {\n position: relative;\n}\n.dv-active-ring-chart .active-ring-chart-container {\n width: 100%;\n height: 100%;\n}\n.dv-active-ring-chart .active-ring-info {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0px;\n top: 0px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n.dv-active-ring-chart .active-ring-info .dv-digital-flop {\n width: 100px;\n height: 30px;\n}\n.dv-active-ring-chart .active-ring-info .active-ring-name {\n width: 100px;\n height: 30px;\n color: #fff;\n text-align: center;\n vertical-align: middle;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n"]}, media: undefined });
  18097. };
  18098. /* scoped */
  18099. const __vue_scope_id__$t = undefined;
  18100. /* module identifier */
  18101. const __vue_module_identifier__$t = undefined;
  18102. /* functional template */
  18103. const __vue_is_functional_template__$t = false;
  18104. /* style inject SSR */
  18105. /* style inject shadow dom */
  18106. const __vue_component__$t = /*#__PURE__*/normalizeComponent(
  18107. { render: __vue_render__$t, staticRenderFns: __vue_staticRenderFns__$t },
  18108. __vue_inject_styles__$t,
  18109. __vue_script__$t,
  18110. __vue_scope_id__$t,
  18111. __vue_is_functional_template__$t,
  18112. __vue_module_identifier__$t,
  18113. false,
  18114. createInjector,
  18115. undefined,
  18116. undefined
  18117. );
  18118. function activeRingChart (Vue) {
  18119. Vue.component(__vue_component__$t.name, __vue_component__$t);
  18120. }
  18121. //
  18122. var script$u = {
  18123. name: 'DvCapsuleChart',
  18124. props: {
  18125. config: {
  18126. type: Object,
  18127. default: () => ({})
  18128. }
  18129. },
  18130. data() {
  18131. return {
  18132. defaultConfig: {
  18133. /**
  18134. * @description Capsule chart data
  18135. * @type {Array<Object>}
  18136. * @default data = []
  18137. * @example data = [{ name: 'foo1', value: 100 }, { name: 'foo2', value: 100 }]
  18138. */
  18139. data: [],
  18140. /**
  18141. * @description Colors (hex|rgb|rgba|color keywords)
  18142. * @type {Array<String>}
  18143. * @default color = ['#37a2da', '#32c5e9', '#67e0e3', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293']
  18144. * @example color = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red']
  18145. */
  18146. colors: ['#37a2da', '#32c5e9', '#67e0e3', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293'],
  18147. /**
  18148. * @description Chart unit
  18149. * @type {String}
  18150. * @default unit = ''
  18151. */
  18152. unit: '',
  18153. /**
  18154. * @description Show item value
  18155. * @type {Boolean}
  18156. * @default showValue = false
  18157. */
  18158. showValue: false
  18159. },
  18160. mergedConfig: null,
  18161. capsuleLength: [],
  18162. capsuleValue: [],
  18163. labelData: [],
  18164. labelDataLength: []
  18165. };
  18166. },
  18167. watch: {
  18168. config() {
  18169. const {
  18170. calcData
  18171. } = this;
  18172. calcData();
  18173. }
  18174. },
  18175. methods: {
  18176. calcData() {
  18177. const {
  18178. mergeConfig,
  18179. calcCapsuleLengthAndLabelData
  18180. } = this;
  18181. mergeConfig();
  18182. calcCapsuleLengthAndLabelData();
  18183. },
  18184. mergeConfig() {
  18185. let {
  18186. config,
  18187. defaultConfig
  18188. } = this;
  18189. this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
  18190. },
  18191. calcCapsuleLengthAndLabelData() {
  18192. const {
  18193. data
  18194. } = this.mergedConfig;
  18195. if (!data.length) return;
  18196. const capsuleValue = data.map(({
  18197. value
  18198. }) => value);
  18199. const maxValue = Math.max(...capsuleValue);
  18200. this.capsuleValue = capsuleValue;
  18201. this.capsuleLength = capsuleValue.map(v => maxValue ? v / maxValue : 0);
  18202. const oneFifth = maxValue / 5;
  18203. const labelData = Array.from(new Set(new Array(6).fill(0).map((v, i) => Math.ceil(i * oneFifth))));
  18204. this.labelData = labelData;
  18205. this.labelDataLength = Array.from(labelData).map(v => maxValue ? v / maxValue : 0);
  18206. }
  18207. },
  18208. mounted() {
  18209. const {
  18210. calcData
  18211. } = this;
  18212. calcData();
  18213. }
  18214. };
  18215. /* script */
  18216. const __vue_script__$u = script$u;
  18217. /* template */
  18218. var __vue_render__$u = function() {
  18219. var _vm = this;
  18220. var _h = _vm.$createElement;
  18221. var _c = _vm._self._c || _h;
  18222. return _c(
  18223. "div",
  18224. { staticClass: "dv-capsule-chart" },
  18225. [
  18226. _vm.mergedConfig
  18227. ? [
  18228. _c(
  18229. "div",
  18230. { staticClass: "label-column" },
  18231. [
  18232. _vm._l(_vm.mergedConfig.data, function(item) {
  18233. return _c("div", { key: item.name }, [
  18234. _vm._v(_vm._s(item.name))
  18235. ])
  18236. }),
  18237. _vm._v(" "),
  18238. _c("div", [_vm._v(" ")])
  18239. ],
  18240. 2
  18241. ),
  18242. _vm._v(" "),
  18243. _c(
  18244. "div",
  18245. { staticClass: "capsule-container" },
  18246. [
  18247. _vm._l(_vm.capsuleLength, function(capsule, index) {
  18248. return _c(
  18249. "div",
  18250. { key: index, staticClass: "capsule-item" },
  18251. [
  18252. _c(
  18253. "div",
  18254. {
  18255. staticClass: "capsule-item-column",
  18256. style:
  18257. "width: " +
  18258. capsule * 100 +
  18259. "%; background-color: " +
  18260. _vm.mergedConfig.colors[
  18261. index % _vm.mergedConfig.colors.length
  18262. ] +
  18263. ";"
  18264. },
  18265. [
  18266. _vm.mergedConfig.showValue
  18267. ? _c("div", { staticClass: "capsule-item-value" }, [
  18268. _vm._v(_vm._s(_vm.capsuleValue[index]))
  18269. ])
  18270. : _vm._e()
  18271. ]
  18272. )
  18273. ]
  18274. )
  18275. }),
  18276. _vm._v(" "),
  18277. _c(
  18278. "div",
  18279. { staticClass: "unit-label" },
  18280. _vm._l(_vm.labelData, function(label, index) {
  18281. return _c("div", { key: label + index }, [
  18282. _vm._v(_vm._s(label))
  18283. ])
  18284. }),
  18285. 0
  18286. )
  18287. ],
  18288. 2
  18289. ),
  18290. _vm._v(" "),
  18291. _vm.mergedConfig.unit
  18292. ? _c("div", { staticClass: "unit-text" }, [
  18293. _vm._v(_vm._s(_vm.mergedConfig.unit))
  18294. ])
  18295. : _vm._e()
  18296. ]
  18297. : _vm._e()
  18298. ],
  18299. 2
  18300. )
  18301. };
  18302. var __vue_staticRenderFns__$u = [];
  18303. __vue_render__$u._withStripped = true;
  18304. /* style */
  18305. const __vue_inject_styles__$u = function (inject) {
  18306. if (!inject) return
  18307. inject("data-v-6f678c1a_0", { source: ".dv-capsule-chart {\n position: relative;\n display: flex;\n flex-direction: row;\n box-sizing: border-box;\n padding: 10px;\n color: #fff;\n}\n.dv-capsule-chart .label-column {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n box-sizing: border-box;\n padding-right: 10px;\n text-align: right;\n font-size: 12px;\n}\n.dv-capsule-chart .label-column div {\n height: 20px;\n line-height: 20px;\n}\n.dv-capsule-chart .capsule-container {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.dv-capsule-chart .capsule-item {\n box-shadow: 0 0 3px #999;\n height: 10px;\n margin: 5px 0px;\n border-radius: 5px;\n}\n.dv-capsule-chart .capsule-item .capsule-item-column {\n position: relative;\n height: 8px;\n margin-top: 1px;\n border-radius: 5px;\n transition: all 0.3s;\n display: flex;\n justify-content: flex-end;\n align-items: center;\n}\n.dv-capsule-chart .capsule-item .capsule-item-column .capsule-item-value {\n font-size: 12px;\n transform: translateX(100%);\n}\n.dv-capsule-chart .unit-label {\n height: 20px;\n font-size: 12px;\n position: relative;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.dv-capsule-chart .unit-text {\n text-align: right;\n display: flex;\n align-items: flex-end;\n font-size: 12px;\n line-height: 20px;\n margin-left: 10px;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,aAAa;EACb,mBAAmB;EACnB,sBAAsB;EACtB,aAAa;EACb,WAAW;AACb;AACA;EACE,aAAa;EACb,sBAAsB;EACtB,8BAA8B;EAC9B,sBAAsB;EACtB,mBAAmB;EACnB,iBAAiB;EACjB,eAAe;AACjB;AACA;EACE,YAAY;EACZ,iBAAiB;AACnB;AACA;EACE,OAAO;EACP,aAAa;EACb,sBAAsB;EACtB,8BAA8B;AAChC;AACA;EACE,wBAAwB;EACxB,YAAY;EACZ,eAAe;EACf,kBAAkB;AACpB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,eAAe;EACf,kBAAkB;EAClB,oBAAoB;EACpB,aAAa;EACb,yBAAyB;EACzB,mBAAmB;AACrB;AACA;EACE,eAAe;EACf,2BAA2B;AAC7B;AACA;EACE,YAAY;EACZ,eAAe;EACf,kBAAkB;EAClB,aAAa;EACb,8BAA8B;EAC9B,mBAAmB;AACrB;AACA;EACE,iBAAiB;EACjB,aAAa;EACb,qBAAqB;EACrB,eAAe;EACf,iBAAiB;EACjB,iBAAiB;AACnB","file":"main.vue","sourcesContent":[".dv-capsule-chart {\n position: relative;\n display: flex;\n flex-direction: row;\n box-sizing: border-box;\n padding: 10px;\n color: #fff;\n}\n.dv-capsule-chart .label-column {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n box-sizing: border-box;\n padding-right: 10px;\n text-align: right;\n font-size: 12px;\n}\n.dv-capsule-chart .label-column div {\n height: 20px;\n line-height: 20px;\n}\n.dv-capsule-chart .capsule-container {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.dv-capsule-chart .capsule-item {\n box-shadow: 0 0 3px #999;\n height: 10px;\n margin: 5px 0px;\n border-radius: 5px;\n}\n.dv-capsule-chart .capsule-item .capsule-item-column {\n position: relative;\n height: 8px;\n margin-top: 1px;\n border-radius: 5px;\n transition: all 0.3s;\n display: flex;\n justify-content: flex-end;\n align-items: center;\n}\n.dv-capsule-chart .capsule-item .capsule-item-column .capsule-item-value {\n font-size: 12px;\n transform: translateX(100%);\n}\n.dv-capsule-chart .unit-label {\n height: 20px;\n font-size: 12px;\n position: relative;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.dv-capsule-chart .unit-text {\n text-align: right;\n display: flex;\n align-items: flex-end;\n font-size: 12px;\n line-height: 20px;\n margin-left: 10px;\n}\n"]}, media: undefined });
  18308. };
  18309. /* scoped */
  18310. const __vue_scope_id__$u = undefined;
  18311. /* module identifier */
  18312. const __vue_module_identifier__$u = undefined;
  18313. /* functional template */
  18314. const __vue_is_functional_template__$u = false;
  18315. /* style inject SSR */
  18316. /* style inject shadow dom */
  18317. const __vue_component__$u = /*#__PURE__*/normalizeComponent(
  18318. { render: __vue_render__$u, staticRenderFns: __vue_staticRenderFns__$u },
  18319. __vue_inject_styles__$u,
  18320. __vue_script__$u,
  18321. __vue_scope_id__$u,
  18322. __vue_is_functional_template__$u,
  18323. __vue_module_identifier__$u,
  18324. false,
  18325. createInjector,
  18326. undefined,
  18327. undefined
  18328. );
  18329. function capsuleChart (Vue) {
  18330. Vue.component(__vue_component__$u.name, __vue_component__$u);
  18331. }
  18332. //
  18333. var script$v = {
  18334. name: 'DvWaterLevelPond',
  18335. props: {
  18336. config: Object,
  18337. default: () => ({})
  18338. },
  18339. data() {
  18340. const id = uuid();
  18341. return {
  18342. gradientId: `water-level-pond-${id}`,
  18343. defaultConfig: {
  18344. /**
  18345. * @description Data
  18346. * @type {Array<Number>}
  18347. * @default data = []
  18348. * @example data = [60, 40]
  18349. */
  18350. data: [],
  18351. /**
  18352. * @description Shape of wanter level pond
  18353. * @type {String}
  18354. * @default shape = 'rect'
  18355. * @example shape = 'rect' | 'roundRect' | 'round'
  18356. */
  18357. shape: 'rect',
  18358. /**
  18359. * @description Water wave number
  18360. * @type {Number}
  18361. * @default waveNum = 3
  18362. */
  18363. waveNum: 3,
  18364. /**
  18365. * @description Water wave height (px)
  18366. * @type {Number}
  18367. * @default waveHeight = 40
  18368. */
  18369. waveHeight: 40,
  18370. /**
  18371. * @description Wave opacity
  18372. * @type {Number}
  18373. * @default waveOpacity = 0.4
  18374. */
  18375. waveOpacity: 0.4,
  18376. /**
  18377. * @description Colors (hex|rgb|rgba|color keywords)
  18378. * @type {Array<String>}
  18379. * @default colors = ['#00BAFF', '#3DE7C9']
  18380. * @example colors = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red']
  18381. */
  18382. colors: ['#3DE7C9', '#00BAFF'],
  18383. /**
  18384. * @description Formatter
  18385. * @type {String}
  18386. * @default formatter = '{value}%'
  18387. */
  18388. formatter: '{value}%'
  18389. },
  18390. mergedConfig: {},
  18391. renderer: null,
  18392. svgBorderGradient: [],
  18393. details: '',
  18394. waves: [],
  18395. animation: false
  18396. };
  18397. },
  18398. computed: {
  18399. radius() {
  18400. const {
  18401. shape
  18402. } = this.mergedConfig;
  18403. if (shape === 'round') return '50%';
  18404. if (shape === 'rect') return '0';
  18405. if (shape === 'roundRect') return '10px';
  18406. return '0';
  18407. },
  18408. shape() {
  18409. const {
  18410. shape
  18411. } = this.mergedConfig;
  18412. if (!shape) return 'rect';
  18413. return shape;
  18414. }
  18415. },
  18416. watch: {
  18417. config() {
  18418. const {
  18419. calcData,
  18420. renderer
  18421. } = this;
  18422. renderer.delAllGraph();
  18423. this.waves = [];
  18424. setTimeout(calcData, 0);
  18425. }
  18426. },
  18427. methods: {
  18428. init() {
  18429. const {
  18430. initRender,
  18431. config,
  18432. calcData
  18433. } = this;
  18434. initRender();
  18435. if (!config) return;
  18436. calcData();
  18437. },
  18438. initRender() {
  18439. const {
  18440. $refs
  18441. } = this;
  18442. this.renderer = new CRender($refs['water-pond-level']);
  18443. },
  18444. calcData() {
  18445. const {
  18446. mergeConfig,
  18447. calcSvgBorderGradient,
  18448. calcDetails
  18449. } = this;
  18450. mergeConfig();
  18451. calcSvgBorderGradient();
  18452. calcDetails();
  18453. const {
  18454. addWave,
  18455. animationWave
  18456. } = this;
  18457. addWave();
  18458. animationWave();
  18459. },
  18460. mergeConfig() {
  18461. const {
  18462. config,
  18463. defaultConfig
  18464. } = this;
  18465. this.mergedConfig = util_2$1(util_1(defaultConfig, true), config);
  18466. },
  18467. calcSvgBorderGradient() {
  18468. const {
  18469. colors
  18470. } = this.mergedConfig;
  18471. const colorNum = colors.length;
  18472. const colorOffsetGap = 100 / (colorNum - 1);
  18473. this.svgBorderGradient = colors.map((c, i) => [colorOffsetGap * i, c]);
  18474. },
  18475. calcDetails() {
  18476. const {
  18477. data,
  18478. formatter
  18479. } = this.mergedConfig;
  18480. if (!data.length) {
  18481. this.details = '';
  18482. return;
  18483. }
  18484. const maxValue = Math.max(...data);
  18485. this.details = formatter.replace('{value}', maxValue);
  18486. },
  18487. addWave() {
  18488. const {
  18489. renderer,
  18490. getWaveShapes,
  18491. getWaveStyle,
  18492. drawed
  18493. } = this;
  18494. const shapes = getWaveShapes();
  18495. const style = getWaveStyle();
  18496. this.waves = shapes.map(shape => renderer.add({
  18497. name: 'smoothline',
  18498. animationFrame: 300,
  18499. shape,
  18500. style,
  18501. drawed
  18502. }));
  18503. },
  18504. getWaveShapes() {
  18505. const {
  18506. mergedConfig,
  18507. renderer,
  18508. mergeOffset
  18509. } = this;
  18510. const {
  18511. waveNum,
  18512. waveHeight,
  18513. data
  18514. } = mergedConfig;
  18515. const [w, h] = renderer.area;
  18516. const pointsNum = waveNum * 4 + 4;
  18517. const pointXGap = w / waveNum / 2;
  18518. return data.map(v => {
  18519. let points = new Array(pointsNum).fill(0).map((foo, j) => {
  18520. const x = w - pointXGap * j;
  18521. const startY = (1 - v / 100) * h;
  18522. const y = j % 2 === 0 ? startY : startY - waveHeight;
  18523. return [x, y];
  18524. });
  18525. points = points.map(p => mergeOffset(p, [pointXGap * 2, 0]));
  18526. return {
  18527. points
  18528. };
  18529. });
  18530. },
  18531. mergeOffset([x, y], [ox, oy]) {
  18532. return [x + ox, y + oy];
  18533. },
  18534. getWaveStyle() {
  18535. const {
  18536. renderer,
  18537. mergedConfig
  18538. } = this;
  18539. const h = renderer.area[1];
  18540. return {
  18541. gradientColor: mergedConfig.colors,
  18542. gradientType: 'linear',
  18543. gradientParams: [0, 0, 0, h],
  18544. gradientWith: 'fill',
  18545. opacity: mergedConfig.waveOpacity,
  18546. translate: [0, 0]
  18547. };
  18548. },
  18549. drawed({
  18550. shape: {
  18551. points
  18552. }
  18553. }, {
  18554. ctx,
  18555. area
  18556. }) {
  18557. const firstPoint = points[0];
  18558. const lastPoint = points.slice(-1)[0];
  18559. const h = area[1];
  18560. ctx.lineTo(lastPoint[0], h);
  18561. ctx.lineTo(firstPoint[0], h);
  18562. ctx.closePath();
  18563. ctx.fill();
  18564. },
  18565. async animationWave(repeat = 1) {
  18566. const {
  18567. waves,
  18568. renderer,
  18569. animation
  18570. } = this;
  18571. if (animation) return;
  18572. this.animation = true;
  18573. const w = renderer.area[0];
  18574. waves.forEach(graph => {
  18575. graph.attr('style', {
  18576. translate: [0, 0]
  18577. });
  18578. graph.animation('style', {
  18579. translate: [w, 0]
  18580. }, true);
  18581. });
  18582. await renderer.launchAnimation();
  18583. this.animation = false;
  18584. if (!renderer.graphs.length) return;
  18585. this.animationWave(repeat + 1);
  18586. }
  18587. },
  18588. mounted() {
  18589. const {
  18590. init
  18591. } = this;
  18592. init();
  18593. },
  18594. beforeDestroy() {
  18595. const {
  18596. renderer
  18597. } = this;
  18598. renderer.delAllGraph();
  18599. this.waves = [];
  18600. }
  18601. };
  18602. /* script */
  18603. const __vue_script__$v = script$v;
  18604. /* template */
  18605. var __vue_render__$v = function() {
  18606. var _vm = this;
  18607. var _h = _vm.$createElement;
  18608. var _c = _vm._self._c || _h;
  18609. return _c("div", { staticClass: "dv-water-pond-level" }, [
  18610. _vm.renderer
  18611. ? _c("svg", [
  18612. _c(
  18613. "defs",
  18614. [
  18615. _c(
  18616. "linearGradient",
  18617. {
  18618. attrs: {
  18619. id: _vm.gradientId,
  18620. x1: "0%",
  18621. y1: "0%",
  18622. x2: "0%",
  18623. y2: "100%"
  18624. }
  18625. },
  18626. _vm._l(_vm.svgBorderGradient, function(lc) {
  18627. return _c("stop", {
  18628. key: lc[0],
  18629. attrs: { offset: lc[0], "stop-color": lc[1] }
  18630. })
  18631. }),
  18632. 1
  18633. )
  18634. ],
  18635. 1
  18636. ),
  18637. _vm._v(" "),
  18638. _vm.renderer
  18639. ? _c(
  18640. "text",
  18641. {
  18642. attrs: {
  18643. stroke: "url(#" + _vm.gradientId + ")",
  18644. fill: "url(#" + _vm.gradientId + ")",
  18645. x: _vm.renderer.area[0] / 2 + 8,
  18646. y: _vm.renderer.area[1] / 2 + 8
  18647. }
  18648. },
  18649. [_vm._v("\n " + _vm._s(_vm.details) + "\n ")]
  18650. )
  18651. : _vm._e(),
  18652. _vm._v(" "),
  18653. !_vm.shape || _vm.shape === "round"
  18654. ? _c("ellipse", {
  18655. attrs: {
  18656. cx: _vm.renderer.area[0] / 2 + 8,
  18657. cy: _vm.renderer.area[1] / 2 + 8,
  18658. rx: _vm.renderer.area[0] / 2 + 5,
  18659. ry: _vm.renderer.area[1] / 2 + 5,
  18660. stroke: "url(#" + _vm.gradientId + ")"
  18661. }
  18662. })
  18663. : _c("rect", {
  18664. attrs: {
  18665. x: "2",
  18666. y: "2",
  18667. rx: _vm.shape === "roundRect" ? 10 : 0,
  18668. ry: _vm.shape === "roundRect" ? 10 : 0,
  18669. width: _vm.renderer.area[0] + 12,
  18670. height: _vm.renderer.area[1] + 12,
  18671. stroke: "url(#" + _vm.gradientId + ")"
  18672. }
  18673. })
  18674. ])
  18675. : _vm._e(),
  18676. _vm._v(" "),
  18677. _c("canvas", {
  18678. ref: "water-pond-level",
  18679. style: "border-radius: " + _vm.radius + ";"
  18680. })
  18681. ])
  18682. };
  18683. var __vue_staticRenderFns__$v = [];
  18684. __vue_render__$v._withStripped = true;
  18685. /* style */
  18686. const __vue_inject_styles__$v = function (inject) {
  18687. if (!inject) return
  18688. inject("data-v-be672a2c_0", { source: ".dv-water-pond-level {\n position: relative;\n}\n.dv-water-pond-level svg {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-water-pond-level text {\n font-size: 25px;\n font-weight: bold;\n text-anchor: middle;\n dominant-baseline: middle;\n}\n.dv-water-pond-level ellipse,\n.dv-water-pond-level rect {\n fill: none;\n stroke-width: 3;\n}\n.dv-water-pond-level canvas {\n margin-top: 8px;\n margin-left: 8px;\n width: calc(100% - 16px);\n height: calc(100% - 16px);\n box-sizing: border-box;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;AACpB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,QAAQ;EACR,SAAS;AACX;AACA;EACE,eAAe;EACf,iBAAiB;EACjB,mBAAmB;EACnB,yBAAyB;AAC3B;AACA;;EAEE,UAAU;EACV,eAAe;AACjB;AACA;EACE,eAAe;EACf,gBAAgB;EAChB,wBAAwB;EACxB,yBAAyB;EACzB,sBAAsB;AACxB","file":"main.vue","sourcesContent":[".dv-water-pond-level {\n position: relative;\n}\n.dv-water-pond-level svg {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n}\n.dv-water-pond-level text {\n font-size: 25px;\n font-weight: bold;\n text-anchor: middle;\n dominant-baseline: middle;\n}\n.dv-water-pond-level ellipse,\n.dv-water-pond-level rect {\n fill: none;\n stroke-width: 3;\n}\n.dv-water-pond-level canvas {\n margin-top: 8px;\n margin-left: 8px;\n width: calc(100% - 16px);\n height: calc(100% - 16px);\n box-sizing: border-box;\n}\n"]}, media: undefined });
  18689. };
  18690. /* scoped */
  18691. const __vue_scope_id__$v = undefined;
  18692. /* module identifier */
  18693. const __vue_module_identifier__$v = undefined;
  18694. /* functional template */
  18695. const __vue_is_functional_template__$v = false;
  18696. /* style inject SSR */
  18697. /* style inject shadow dom */
  18698. const __vue_component__$v = /*#__PURE__*/normalizeComponent(
  18699. { render: __vue_render__$v, staticRenderFns: __vue_staticRenderFns__$v },
  18700. __vue_inject_styles__$v,
  18701. __vue_script__$v,
  18702. __vue_scope_id__$v,
  18703. __vue_is_functional_template__$v,
  18704. __vue_module_identifier__$v,
  18705. false,
  18706. createInjector,
  18707. undefined,
  18708. undefined
  18709. );
  18710. function waterLevelPond (Vue) {
  18711. Vue.component(__vue_component__$v.name, __vue_component__$v);
  18712. }
  18713. //
  18714. var script$w = {
  18715. name: 'DvPercentPond',
  18716. props: {
  18717. config: {
  18718. type: Object,
  18719. default: () => ({})
  18720. }
  18721. },
  18722. data() {
  18723. const id = uuid();
  18724. return {
  18725. gradientId1: `percent-pond-gradientId1-${id}`,
  18726. gradientId2: `percent-pond-gradientId2-${id}`,
  18727. width: 0,
  18728. height: 0,
  18729. defaultConfig: {
  18730. /**
  18731. * @description Value
  18732. * @type {Number}
  18733. * @default value = 0
  18734. */
  18735. value: 0,
  18736. /**
  18737. * @description Colors (hex|rgb|rgba|color keywords)
  18738. * @type {Array<String>}
  18739. * @default colors = ['#00BAFF', '#3DE7C9']
  18740. * @example colors = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red']
  18741. */
  18742. colors: ['#3DE7C9', '#00BAFF'],
  18743. /**
  18744. * @description Border width
  18745. * @type {Number}
  18746. * @default borderWidth = 3
  18747. */
  18748. borderWidth: 3,
  18749. /**
  18750. * @description Gap between border and pond
  18751. * @type {Number}
  18752. * @default borderGap = 3
  18753. */
  18754. borderGap: 3,
  18755. /**
  18756. * @description Line dash
  18757. * @type {Array<Number>}
  18758. * @default lineDash = [5, 1]
  18759. */
  18760. lineDash: [5, 1],
  18761. /**
  18762. * @description Text color
  18763. * @type {String}
  18764. * @default textColor = '#fff'
  18765. */
  18766. textColor: '#fff',
  18767. /**
  18768. * @description Border radius
  18769. * @type {Number}
  18770. * @default borderRadius = 5
  18771. */
  18772. borderRadius: 5,
  18773. /**
  18774. * @description Local Gradient
  18775. * @type {Boolean}
  18776. * @default localGradient = false
  18777. * @example localGradient = false | true
  18778. */
  18779. localGradient: false,
  18780. /**
  18781. * @description Formatter
  18782. * @type {String}
  18783. * @default formatter = '{value}%'
  18784. */
  18785. formatter: '{value}%'
  18786. },
  18787. mergedConfig: null
  18788. };
  18789. },
  18790. computed: {
  18791. rectWidth() {
  18792. const {
  18793. mergedConfig,
  18794. width
  18795. } = this;
  18796. if (!mergedConfig) return 0;
  18797. const {
  18798. borderWidth
  18799. } = mergedConfig;
  18800. return width - borderWidth;
  18801. },
  18802. rectHeight() {
  18803. const {
  18804. mergedConfig,
  18805. height
  18806. } = this;
  18807. if (!mergedConfig) return 0;
  18808. const {
  18809. borderWidth
  18810. } = mergedConfig;
  18811. return height - borderWidth;
  18812. },
  18813. points() {
  18814. const {
  18815. mergedConfig,
  18816. width,
  18817. height
  18818. } = this;
  18819. const halfHeight = height / 2;
  18820. if (!mergedConfig) return `0, ${halfHeight} 0, ${halfHeight}`;
  18821. const {
  18822. borderWidth,
  18823. borderGap,
  18824. value
  18825. } = mergedConfig;
  18826. const polylineLength = (width - (borderWidth + borderGap) * 2) / 100 * value;
  18827. return `
  18828. ${borderWidth + borderGap}, ${halfHeight}
  18829. ${borderWidth + borderGap + polylineLength}, ${halfHeight + 0.001}
  18830. `;
  18831. },
  18832. polylineWidth() {
  18833. const {
  18834. mergedConfig,
  18835. height
  18836. } = this;
  18837. if (!mergedConfig) return 0;
  18838. const {
  18839. borderWidth,
  18840. borderGap
  18841. } = mergedConfig;
  18842. return height - (borderWidth + borderGap) * 2;
  18843. },
  18844. linearGradient() {
  18845. const {
  18846. mergedConfig
  18847. } = this;
  18848. if (!mergedConfig) return [];
  18849. const {
  18850. colors
  18851. } = mergedConfig;
  18852. const colorNum = colors.length;
  18853. const colorOffsetGap = 100 / (colorNum - 1);
  18854. return colors.map((c, i) => [colorOffsetGap * i, c]);
  18855. },
  18856. polylineGradient() {
  18857. const {
  18858. gradientId1,
  18859. gradientId2,
  18860. mergedConfig
  18861. } = this;
  18862. if (!mergedConfig) return gradientId2;
  18863. if (mergedConfig.localGradient) return gradientId1;
  18864. return gradientId2;
  18865. },
  18866. gradient2XPos() {
  18867. const {
  18868. mergedConfig
  18869. } = this;
  18870. if (!mergedConfig) return '100%';
  18871. const {
  18872. value
  18873. } = mergedConfig;
  18874. return `${200 - value}%`;
  18875. },
  18876. details() {
  18877. const {
  18878. mergedConfig
  18879. } = this;
  18880. if (!mergedConfig) return '';
  18881. const {
  18882. value,
  18883. formatter
  18884. } = mergedConfig;
  18885. return formatter.replace('{value}', value);
  18886. }
  18887. },
  18888. watch: {
  18889. config() {
  18890. const {
  18891. mergeConfig
  18892. } = this;
  18893. mergeConfig();
  18894. }
  18895. },
  18896. methods: {
  18897. async init() {
  18898. const {
  18899. initWH,
  18900. config,
  18901. mergeConfig
  18902. } = this;
  18903. await initWH();
  18904. if (!config) return;
  18905. mergeConfig();
  18906. },
  18907. async initWH() {
  18908. const {
  18909. $nextTick,
  18910. $refs
  18911. } = this;
  18912. await $nextTick();
  18913. const {
  18914. clientWidth,
  18915. clientHeight
  18916. } = $refs['percent-pond'];
  18917. this.width = clientWidth;
  18918. this.height = clientHeight;
  18919. },
  18920. mergeConfig() {
  18921. const {
  18922. config,
  18923. defaultConfig
  18924. } = this;
  18925. this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
  18926. }
  18927. },
  18928. mounted() {
  18929. const {
  18930. init
  18931. } = this;
  18932. init();
  18933. }
  18934. };
  18935. /* script */
  18936. const __vue_script__$w = script$w;
  18937. /* template */
  18938. var __vue_render__$w = function() {
  18939. var _vm = this;
  18940. var _h = _vm.$createElement;
  18941. var _c = _vm._self._c || _h;
  18942. return _c("div", { ref: "percent-pond", staticClass: "dv-percent-pond" }, [
  18943. _c("svg", [
  18944. _c(
  18945. "defs",
  18946. [
  18947. _c(
  18948. "linearGradient",
  18949. {
  18950. attrs: {
  18951. id: _vm.gradientId1,
  18952. x1: "0%",
  18953. y1: "0%",
  18954. x2: "100%",
  18955. y2: "0%"
  18956. }
  18957. },
  18958. _vm._l(_vm.linearGradient, function(lc) {
  18959. return _c("stop", {
  18960. key: lc[0],
  18961. attrs: { offset: lc[0] + "%", "stop-color": lc[1] }
  18962. })
  18963. }),
  18964. 1
  18965. ),
  18966. _vm._v(" "),
  18967. _c(
  18968. "linearGradient",
  18969. {
  18970. attrs: {
  18971. id: _vm.gradientId2,
  18972. x1: "0%",
  18973. y1: "0%",
  18974. x2: _vm.gradient2XPos,
  18975. y2: "0%"
  18976. }
  18977. },
  18978. _vm._l(_vm.linearGradient, function(lc) {
  18979. return _c("stop", {
  18980. key: lc[0],
  18981. attrs: { offset: lc[0] + "%", "stop-color": lc[1] }
  18982. })
  18983. }),
  18984. 1
  18985. )
  18986. ],
  18987. 1
  18988. ),
  18989. _vm._v(" "),
  18990. _c("rect", {
  18991. attrs: {
  18992. x: _vm.mergedConfig ? _vm.mergedConfig.borderWidth / 2 : "0",
  18993. y: _vm.mergedConfig ? _vm.mergedConfig.borderWidth / 2 : "0",
  18994. rx: _vm.mergedConfig ? _vm.mergedConfig.borderRadius : "0",
  18995. ry: _vm.mergedConfig ? _vm.mergedConfig.borderRadius : "0",
  18996. fill: "transparent",
  18997. "stroke-width": _vm.mergedConfig ? _vm.mergedConfig.borderWidth : "0",
  18998. stroke: "url(#" + _vm.gradientId1 + ")",
  18999. width: _vm.rectWidth > 0 ? _vm.rectWidth : 0,
  19000. height: _vm.rectHeight > 0 ? _vm.rectHeight : 0
  19001. }
  19002. }),
  19003. _vm._v(" "),
  19004. _c("polyline", {
  19005. attrs: {
  19006. "stroke-width": _vm.polylineWidth,
  19007. "stroke-dasharray": _vm.mergedConfig
  19008. ? _vm.mergedConfig.lineDash.join(",")
  19009. : "0",
  19010. stroke: "url(#" + _vm.polylineGradient + ")",
  19011. points: _vm.points
  19012. }
  19013. }),
  19014. _vm._v(" "),
  19015. _c(
  19016. "text",
  19017. {
  19018. attrs: {
  19019. stroke: _vm.mergedConfig ? _vm.mergedConfig.textColor : "#fff",
  19020. fill: _vm.mergedConfig ? _vm.mergedConfig.textColor : "#fff",
  19021. x: _vm.width / 2,
  19022. y: _vm.height / 2
  19023. }
  19024. },
  19025. [_vm._v("\n " + _vm._s(_vm.details) + "\n ")]
  19026. )
  19027. ])
  19028. ])
  19029. };
  19030. var __vue_staticRenderFns__$w = [];
  19031. __vue_render__$w._withStripped = true;
  19032. /* style */
  19033. const __vue_inject_styles__$w = function (inject) {
  19034. if (!inject) return
  19035. inject("data-v-05a0166f_0", { source: ".dv-percent-pond {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n.dv-percent-pond svg {\n position: absolute;\n left: 0px;\n top: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-percent-pond polyline {\n transition: all 0.3s;\n}\n.dv-percent-pond text {\n font-size: 25px;\n font-weight: bold;\n text-anchor: middle;\n dominant-baseline: middle;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,aAAa;EACb,sBAAsB;AACxB;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,WAAW;EACX,YAAY;AACd;AACA;EACE,oBAAoB;AACtB;AACA;EACE,eAAe;EACf,iBAAiB;EACjB,mBAAmB;EACnB,yBAAyB;AAC3B","file":"main.vue","sourcesContent":[".dv-percent-pond {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n.dv-percent-pond svg {\n position: absolute;\n left: 0px;\n top: 0px;\n width: 100%;\n height: 100%;\n}\n.dv-percent-pond polyline {\n transition: all 0.3s;\n}\n.dv-percent-pond text {\n font-size: 25px;\n font-weight: bold;\n text-anchor: middle;\n dominant-baseline: middle;\n}\n"]}, media: undefined });
  19036. };
  19037. /* scoped */
  19038. const __vue_scope_id__$w = undefined;
  19039. /* module identifier */
  19040. const __vue_module_identifier__$w = undefined;
  19041. /* functional template */
  19042. const __vue_is_functional_template__$w = false;
  19043. /* style inject SSR */
  19044. /* style inject shadow dom */
  19045. const __vue_component__$w = /*#__PURE__*/normalizeComponent(
  19046. { render: __vue_render__$w, staticRenderFns: __vue_staticRenderFns__$w },
  19047. __vue_inject_styles__$w,
  19048. __vue_script__$w,
  19049. __vue_scope_id__$w,
  19050. __vue_is_functional_template__$w,
  19051. __vue_module_identifier__$w,
  19052. false,
  19053. createInjector,
  19054. undefined,
  19055. undefined
  19056. );
  19057. function percentPond (Vue) {
  19058. Vue.component(__vue_component__$w.name, __vue_component__$w);
  19059. }
  19060. //
  19061. var script$x = {
  19062. name: 'DvFlylineChart',
  19063. mixins: [autoResize],
  19064. props: {
  19065. config: {
  19066. type: Object,
  19067. default: () => ({})
  19068. },
  19069. dev: {
  19070. type: Boolean,
  19071. default: false
  19072. }
  19073. },
  19074. data() {
  19075. const id = uuid();
  19076. return {
  19077. ref: 'dv-flyline-chart',
  19078. unique: Math.random(),
  19079. maskId: `flyline-mask-id-${id}`,
  19080. maskCircleId: `mask-circle-id-${id}`,
  19081. gradientId: `gradient-id-${id}`,
  19082. gradient2Id: `gradient2-id-${id}`,
  19083. defaultConfig: {
  19084. /**
  19085. * @description Flyline chart center point
  19086. * @type {Array<Number>}
  19087. * @default centerPoint = [0, 0]
  19088. */
  19089. centerPoint: [0, 0],
  19090. /**
  19091. * @description Flyline start points
  19092. * @type {Array<Array<Number>>}
  19093. * @default points = []
  19094. * @example points = [[10, 10], [100, 100]]
  19095. */
  19096. points: [],
  19097. /**
  19098. * @description Flyline width
  19099. * @type {Number}
  19100. * @default lineWidth = 1
  19101. */
  19102. lineWidth: 1,
  19103. /**
  19104. * @description Orbit color
  19105. * @type {String}
  19106. * @default orbitColor = 'rgba(103, 224, 227, .2)'
  19107. */
  19108. orbitColor: 'rgba(103, 224, 227, .2)',
  19109. /**
  19110. * @description Flyline color
  19111. * @type {String}
  19112. * @default orbitColor = '#ffde93'
  19113. */
  19114. flylineColor: '#ffde93',
  19115. /**
  19116. * @description K value
  19117. * @type {Number}
  19118. * @default k = -0.5
  19119. * @example k = -1 ~ 1
  19120. */
  19121. k: -0.5,
  19122. /**
  19123. * @description Flyline curvature
  19124. * @type {Number}
  19125. * @default curvature = 5
  19126. */
  19127. curvature: 5,
  19128. /**
  19129. * @description Flyline radius
  19130. * @type {Number}
  19131. * @default flylineRadius = 100
  19132. */
  19133. flylineRadius: 100,
  19134. /**
  19135. * @description Flyline animation duration
  19136. * @type {Array<Number>}
  19137. * @default duration = [20, 30]
  19138. */
  19139. duration: [20, 30],
  19140. /**
  19141. * @description Relative points position
  19142. * @type {Boolean}
  19143. * @default relative = true
  19144. */
  19145. relative: true,
  19146. /**
  19147. * @description Back ground image url
  19148. * @type {String}
  19149. * @default bgImgUrl = ''
  19150. * @example bgImgUrl = './img/bg.jpg'
  19151. */
  19152. bgImgUrl: '',
  19153. /**
  19154. * @description Text configuration
  19155. * @type {Object}
  19156. */
  19157. text: {
  19158. /**
  19159. * @description Text offset
  19160. * @type {Array<Number>}
  19161. * @default offset = [0, 15]
  19162. */
  19163. offset: [0, 15],
  19164. /**
  19165. * @description Text color
  19166. * @type {String}
  19167. * @default color = '#ffdb5c'
  19168. */
  19169. color: '#ffdb5c',
  19170. /**
  19171. * @description Text font size
  19172. * @type {Number}
  19173. * @default fontSize = 12
  19174. */
  19175. fontSize: 12
  19176. },
  19177. /**
  19178. * @description Halo configuration
  19179. * @type {Object}
  19180. */
  19181. halo: {
  19182. /**
  19183. * @description Weather to show halo
  19184. * @type {Boolean}
  19185. * @default show = true
  19186. * @example show = true | false
  19187. */
  19188. show: true,
  19189. /**
  19190. * @description Halo animation duration (10 = 1s)
  19191. * @type {Number}
  19192. * @default duration = 30
  19193. */
  19194. duration: 30,
  19195. /**
  19196. * @description Halo color
  19197. * @type {String}
  19198. * @default color = '#fb7293'
  19199. */
  19200. color: '#fb7293',
  19201. /**
  19202. * @description Halo max radius
  19203. * @type {Number}
  19204. * @default radius = 120
  19205. */
  19206. radius: 120
  19207. },
  19208. /**
  19209. * @description Center point img configuration
  19210. * @type {Object}
  19211. */
  19212. centerPointImg: {
  19213. /**
  19214. * @description Center point img width
  19215. * @type {Number}
  19216. * @default width = 40
  19217. */
  19218. width: 40,
  19219. /**
  19220. * @description Center point img height
  19221. * @type {Number}
  19222. * @default height = 40
  19223. */
  19224. height: 40,
  19225. /**
  19226. * @description Center point img url
  19227. * @type {String}
  19228. * @default url = ''
  19229. */
  19230. url: ''
  19231. },
  19232. /**
  19233. * @description Points img configuration
  19234. * @type {Object}
  19235. * @default radius = 120
  19236. */
  19237. pointsImg: {
  19238. /**
  19239. * @description Points img width
  19240. * @type {Number}
  19241. * @default width = 15
  19242. */
  19243. width: 15,
  19244. /**
  19245. * @description Points img height
  19246. * @type {Number}
  19247. * @default height = 15
  19248. */
  19249. height: 15,
  19250. /**
  19251. * @description Points img url
  19252. * @type {String}
  19253. * @default url = ''
  19254. */
  19255. url: ''
  19256. }
  19257. },
  19258. mergedConfig: null,
  19259. paths: [],
  19260. lengths: [],
  19261. times: [],
  19262. texts: []
  19263. };
  19264. },
  19265. watch: {
  19266. config() {
  19267. const {
  19268. calcData
  19269. } = this;
  19270. calcData();
  19271. }
  19272. },
  19273. methods: {
  19274. afterAutoResizeMixinInit() {
  19275. const {
  19276. calcData
  19277. } = this;
  19278. calcData();
  19279. },
  19280. onResize() {
  19281. const {
  19282. calcData
  19283. } = this;
  19284. calcData();
  19285. },
  19286. async calcData() {
  19287. const {
  19288. mergeConfig,
  19289. createFlylinePaths,
  19290. calcLineLengths
  19291. } = this;
  19292. mergeConfig();
  19293. createFlylinePaths();
  19294. await calcLineLengths();
  19295. const {
  19296. calcTimes,
  19297. calcTexts
  19298. } = this;
  19299. calcTimes();
  19300. calcTexts();
  19301. },
  19302. mergeConfig() {
  19303. let {
  19304. config,
  19305. defaultConfig
  19306. } = this;
  19307. const mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
  19308. const {
  19309. points
  19310. } = mergedConfig;
  19311. mergedConfig.points = points.map(item => {
  19312. if (item instanceof Array) {
  19313. return {
  19314. position: item,
  19315. text: ''
  19316. };
  19317. }
  19318. return item;
  19319. });
  19320. this.mergedConfig = mergedConfig;
  19321. },
  19322. createFlylinePaths() {
  19323. const {
  19324. getPath,
  19325. mergedConfig,
  19326. width,
  19327. height
  19328. } = this;
  19329. let {
  19330. centerPoint,
  19331. points,
  19332. relative
  19333. } = mergedConfig;
  19334. points = points.map(({
  19335. position
  19336. }) => position);
  19337. if (relative) {
  19338. centerPoint = [width * centerPoint[0], height * centerPoint[1]];
  19339. points = points.map(([x, y]) => [width * x, height * y]);
  19340. }
  19341. this.paths = points.map(point => getPath(centerPoint, point));
  19342. },
  19343. getPath(center, point) {
  19344. const {
  19345. getControlPoint
  19346. } = this;
  19347. const controlPoint = getControlPoint(center, point);
  19348. return [point, controlPoint, center];
  19349. },
  19350. getControlPoint([sx, sy], [ex, ey]) {
  19351. const {
  19352. getKLinePointByx,
  19353. mergedConfig
  19354. } = this;
  19355. const {
  19356. curvature,
  19357. k
  19358. } = mergedConfig;
  19359. const [mx, my] = [(sx + ex) / 2, (sy + ey) / 2];
  19360. const distance = getPointDistance([sx, sy], [ex, ey]);
  19361. const targetLength = distance / curvature;
  19362. const disDived = targetLength / 2;
  19363. let [dx, dy] = [mx, my];
  19364. do {
  19365. dx += disDived;
  19366. dy = getKLinePointByx(k, [mx, my], dx)[1];
  19367. } while (getPointDistance([mx, my], [dx, dy]) < targetLength);
  19368. return [dx, dy];
  19369. },
  19370. getKLinePointByx(k, [lx, ly], x) {
  19371. const y = ly - k * lx + k * x;
  19372. return [x, y];
  19373. },
  19374. async calcLineLengths() {
  19375. const {
  19376. $nextTick,
  19377. paths,
  19378. $refs
  19379. } = this;
  19380. await $nextTick();
  19381. this.lengths = paths.map((foo, i) => $refs[`path${i}`][0].getTotalLength());
  19382. },
  19383. calcTimes() {
  19384. const {
  19385. duration,
  19386. points
  19387. } = this.mergedConfig;
  19388. this.times = points.map(foo => randomExtend(...duration) / 10);
  19389. },
  19390. calcTexts() {
  19391. const {
  19392. points
  19393. } = this.mergedConfig;
  19394. this.texts = points.map(({
  19395. text
  19396. }) => text);
  19397. },
  19398. consoleClickPos({
  19399. offsetX,
  19400. offsetY
  19401. }) {
  19402. const {
  19403. width,
  19404. height,
  19405. dev
  19406. } = this;
  19407. if (!dev) return;
  19408. const relativeX = (offsetX / width).toFixed(2);
  19409. const relativeY = (offsetY / height).toFixed(2);
  19410. console.warn(`dv-flyline-chart DEV: \n Click Position is [${offsetX}, ${offsetY}] \n Relative Position is [${relativeX}, ${relativeY}]`);
  19411. }
  19412. }
  19413. };
  19414. /* script */
  19415. const __vue_script__$x = script$x;
  19416. /* template */
  19417. var __vue_render__$x = function() {
  19418. var _vm = this;
  19419. var _h = _vm.$createElement;
  19420. var _c = _vm._self._c || _h;
  19421. return _c(
  19422. "div",
  19423. {
  19424. ref: "dv-flyline-chart",
  19425. staticClass: "dv-flyline-chart",
  19426. style:
  19427. "background-image: url(" +
  19428. (_vm.mergedConfig ? _vm.mergedConfig.bgImgUrl : "") +
  19429. ")",
  19430. on: { click: _vm.consoleClickPos }
  19431. },
  19432. [
  19433. _vm.mergedConfig
  19434. ? _c(
  19435. "svg",
  19436. { attrs: { width: _vm.width, height: _vm.height } },
  19437. [
  19438. _c(
  19439. "defs",
  19440. [
  19441. _c(
  19442. "radialGradient",
  19443. {
  19444. attrs: {
  19445. id: _vm.gradientId,
  19446. cx: "50%",
  19447. cy: "50%",
  19448. r: "50%"
  19449. }
  19450. },
  19451. [
  19452. _c("stop", {
  19453. attrs: {
  19454. offset: "0%",
  19455. "stop-color": "#fff",
  19456. "stop-opacity": "1"
  19457. }
  19458. }),
  19459. _vm._v(" "),
  19460. _c("stop", {
  19461. attrs: {
  19462. offset: "100%",
  19463. "stop-color": "#fff",
  19464. "stop-opacity": "0"
  19465. }
  19466. })
  19467. ],
  19468. 1
  19469. ),
  19470. _vm._v(" "),
  19471. _c(
  19472. "radialGradient",
  19473. {
  19474. attrs: {
  19475. id: _vm.gradient2Id,
  19476. cx: "50%",
  19477. cy: "50%",
  19478. r: "50%"
  19479. }
  19480. },
  19481. [
  19482. _c("stop", {
  19483. attrs: {
  19484. offset: "0%",
  19485. "stop-color": "#fff",
  19486. "stop-opacity": "0"
  19487. }
  19488. }),
  19489. _vm._v(" "),
  19490. _c("stop", {
  19491. attrs: {
  19492. offset: "100%",
  19493. "stop-color": "#fff",
  19494. "stop-opacity": "1"
  19495. }
  19496. })
  19497. ],
  19498. 1
  19499. ),
  19500. _vm._v(" "),
  19501. _vm.paths[0]
  19502. ? _c(
  19503. "circle",
  19504. {
  19505. attrs: {
  19506. id: "circle" + _vm.paths[0].toString(),
  19507. cx: _vm.paths[0][2][0],
  19508. cy: _vm.paths[0][2][1]
  19509. }
  19510. },
  19511. [
  19512. _c("animate", {
  19513. attrs: {
  19514. attributeName: "r",
  19515. values: "1;" + _vm.mergedConfig.halo.radius,
  19516. dur: _vm.mergedConfig.halo.duration / 10 + "s",
  19517. repeatCount: "indefinite"
  19518. }
  19519. }),
  19520. _vm._v(" "),
  19521. _c("animate", {
  19522. attrs: {
  19523. attributeName: "opacity",
  19524. values: "1;0",
  19525. dur: _vm.mergedConfig.halo.duration / 10 + "s",
  19526. repeatCount: "indefinite"
  19527. }
  19528. })
  19529. ]
  19530. )
  19531. : _vm._e()
  19532. ],
  19533. 1
  19534. ),
  19535. _vm._v(" "),
  19536. _vm.paths[0]
  19537. ? _c("image", {
  19538. attrs: {
  19539. "xlink:href": _vm.mergedConfig.centerPointImg.url,
  19540. width: _vm.mergedConfig.centerPointImg.width,
  19541. height: _vm.mergedConfig.centerPointImg.height,
  19542. x:
  19543. _vm.paths[0][2][0] -
  19544. _vm.mergedConfig.centerPointImg.width / 2,
  19545. y:
  19546. _vm.paths[0][2][1] -
  19547. _vm.mergedConfig.centerPointImg.height / 2
  19548. }
  19549. })
  19550. : _vm._e(),
  19551. _vm._v(" "),
  19552. _c(
  19553. "mask",
  19554. { attrs: { id: "maskhalo" + _vm.paths[0].toString() } },
  19555. [
  19556. _vm.paths[0]
  19557. ? _c("use", {
  19558. attrs: {
  19559. "xlink:href": "#circle" + _vm.paths[0].toString(),
  19560. fill: "url(#" + _vm.gradient2Id + ")"
  19561. }
  19562. })
  19563. : _vm._e()
  19564. ]
  19565. ),
  19566. _vm._v(" "),
  19567. _vm.paths[0] && _vm.mergedConfig.halo.show
  19568. ? _c("use", {
  19569. attrs: {
  19570. "xlink:href": "#circle" + _vm.paths[0].toString(),
  19571. fill: _vm.mergedConfig.halo.color,
  19572. mask: "url(#maskhalo" + _vm.paths[0].toString() + ")"
  19573. }
  19574. })
  19575. : _vm._e(),
  19576. _vm._v(" "),
  19577. _vm._l(_vm.paths, function(path, i) {
  19578. return _c("g", { key: i }, [
  19579. _c("defs", [
  19580. _c("path", {
  19581. ref: "path" + i,
  19582. refInFor: true,
  19583. attrs: {
  19584. id: "path" + path.toString(),
  19585. d:
  19586. "M" +
  19587. path[0].toString() +
  19588. " Q" +
  19589. path[1].toString() +
  19590. " " +
  19591. path[2].toString(),
  19592. fill: "transparent"
  19593. }
  19594. })
  19595. ]),
  19596. _vm._v(" "),
  19597. _c("use", {
  19598. attrs: {
  19599. "xlink:href": "#path" + path.toString(),
  19600. "stroke-width": _vm.mergedConfig.lineWidth,
  19601. stroke: _vm.mergedConfig.orbitColor
  19602. }
  19603. }),
  19604. _vm._v(" "),
  19605. _vm.lengths[i]
  19606. ? _c(
  19607. "use",
  19608. {
  19609. attrs: {
  19610. "xlink:href": "#path" + path.toString(),
  19611. "stroke-width": _vm.mergedConfig.lineWidth,
  19612. stroke: _vm.mergedConfig.flylineColor,
  19613. mask:
  19614. "url(#mask" + _vm.unique + path.toString() + ")"
  19615. }
  19616. },
  19617. [
  19618. _c("animate", {
  19619. attrs: {
  19620. attributeName: "stroke-dasharray",
  19621. from: "0, " + _vm.lengths[i],
  19622. to: _vm.lengths[i] + ", 0",
  19623. dur: _vm.times[i] || 0,
  19624. repeatCount: "indefinite"
  19625. }
  19626. })
  19627. ]
  19628. )
  19629. : _vm._e(),
  19630. _vm._v(" "),
  19631. _c(
  19632. "mask",
  19633. { attrs: { id: "mask" + _vm.unique + path.toString() } },
  19634. [
  19635. _c(
  19636. "circle",
  19637. {
  19638. attrs: {
  19639. cx: "0",
  19640. cy: "0",
  19641. r: _vm.mergedConfig.flylineRadius,
  19642. fill: "url(#" + _vm.gradientId + ")"
  19643. }
  19644. },
  19645. [
  19646. _c("animateMotion", {
  19647. attrs: {
  19648. dur: _vm.times[i] || 0,
  19649. path:
  19650. "M" +
  19651. path[0].toString() +
  19652. " Q" +
  19653. path[1].toString() +
  19654. " " +
  19655. path[2].toString(),
  19656. rotate: "auto",
  19657. repeatCount: "indefinite"
  19658. }
  19659. })
  19660. ],
  19661. 1
  19662. )
  19663. ]
  19664. ),
  19665. _vm._v(" "),
  19666. _c("image", {
  19667. attrs: {
  19668. "xlink:href": _vm.mergedConfig.pointsImg.url,
  19669. width: _vm.mergedConfig.pointsImg.width,
  19670. height: _vm.mergedConfig.pointsImg.height,
  19671. x: path[0][0] - _vm.mergedConfig.pointsImg.width / 2,
  19672. y: path[0][1] - _vm.mergedConfig.pointsImg.height / 2
  19673. }
  19674. }),
  19675. _vm._v(" "),
  19676. _c(
  19677. "text",
  19678. {
  19679. style:
  19680. "fontSize:" + _vm.mergedConfig.text.fontSize + "px;",
  19681. attrs: {
  19682. fill: _vm.mergedConfig.text.color,
  19683. x: path[0][0] + _vm.mergedConfig.text.offset[0],
  19684. y: path[0][1] + _vm.mergedConfig.text.offset[1]
  19685. }
  19686. },
  19687. [_vm._v("\n " + _vm._s(_vm.texts[i]) + "\n ")]
  19688. )
  19689. ])
  19690. })
  19691. ],
  19692. 2
  19693. )
  19694. : _vm._e()
  19695. ]
  19696. )
  19697. };
  19698. var __vue_staticRenderFns__$x = [];
  19699. __vue_render__$x._withStripped = true;
  19700. /* style */
  19701. const __vue_inject_styles__$x = function (inject) {
  19702. if (!inject) return
  19703. inject("data-v-1edfcf29_0", { source: ".dv-flyline-chart {\n display: flex;\n flex-direction: column;\n background-size: 100% 100%;\n}\n.dv-flyline-chart polyline {\n transition: all 0.3s;\n}\n.dv-flyline-chart text {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,sBAAsB;EACtB,0BAA0B;AAC5B;AACA;EACE,oBAAoB;AACtB;AACA;EACE,mBAAmB;EACnB,yBAAyB;AAC3B","file":"main.vue","sourcesContent":[".dv-flyline-chart {\n display: flex;\n flex-direction: column;\n background-size: 100% 100%;\n}\n.dv-flyline-chart polyline {\n transition: all 0.3s;\n}\n.dv-flyline-chart text {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n"]}, media: undefined });
  19704. };
  19705. /* scoped */
  19706. const __vue_scope_id__$x = undefined;
  19707. /* module identifier */
  19708. const __vue_module_identifier__$x = undefined;
  19709. /* functional template */
  19710. const __vue_is_functional_template__$x = false;
  19711. /* style inject SSR */
  19712. /* style inject shadow dom */
  19713. const __vue_component__$x = /*#__PURE__*/normalizeComponent(
  19714. { render: __vue_render__$x, staticRenderFns: __vue_staticRenderFns__$x },
  19715. __vue_inject_styles__$x,
  19716. __vue_script__$x,
  19717. __vue_scope_id__$x,
  19718. __vue_is_functional_template__$x,
  19719. __vue_module_identifier__$x,
  19720. false,
  19721. createInjector,
  19722. undefined,
  19723. undefined
  19724. );
  19725. function flylineChart (Vue) {
  19726. Vue.component(__vue_component__$x.name, __vue_component__$x);
  19727. }
  19728. //
  19729. var script$y = {
  19730. name: 'DvFlylineChartEnhanced',
  19731. mixins: [autoResize],
  19732. props: {
  19733. config: {
  19734. type: Object,
  19735. default: () => ({})
  19736. },
  19737. dev: {
  19738. type: Boolean,
  19739. default: false
  19740. }
  19741. },
  19742. data() {
  19743. const id = uuid();
  19744. return {
  19745. ref: 'dv-flyline-chart-enhanced',
  19746. unique: Math.random(),
  19747. flylineGradientId: `flyline-gradient-id-${id}`,
  19748. haloGradientId: `halo-gradient-id-${id}`,
  19749. /**
  19750. * @description Type Declaration
  19751. *
  19752. * interface Halo {
  19753. * show?: boolean
  19754. * duration?: [number, number]
  19755. * color?: string
  19756. * radius?: number
  19757. * }
  19758. *
  19759. * interface Text {
  19760. * show?: boolean
  19761. * offset?: [number, number]
  19762. * color?: string
  19763. * fontSize?: number
  19764. * }
  19765. *
  19766. * interface Icon {
  19767. * show?: boolean
  19768. * src?: string
  19769. * width?: number
  19770. * height?: number
  19771. * }
  19772. *
  19773. * interface Point {
  19774. * name: string
  19775. * coordinate: [number, number]
  19776. * halo?: Halo
  19777. * text?: Text
  19778. * icon?: Icon
  19779. * }
  19780. *
  19781. * interface Line {
  19782. * width?: number
  19783. * color?: string
  19784. * orbitColor?: string
  19785. * duration?: [number, number]
  19786. * radius?: string
  19787. * }
  19788. *
  19789. * interface Flyline extends Line {
  19790. * source: string
  19791. * target: string
  19792. * }
  19793. *
  19794. * interface FlylineWithPath extends Flyline {
  19795. * d: string
  19796. * path: [[number, number], [number, number], [number, number]]
  19797. * key: string
  19798. * }
  19799. */
  19800. defaultConfig: {
  19801. /**
  19802. * @description Flyline chart points
  19803. * @type {Point[]}
  19804. * @default points = []
  19805. */
  19806. points: [],
  19807. /**
  19808. * @description Lines
  19809. * @type {Flyline[]}
  19810. * @default lines = []
  19811. */
  19812. lines: [],
  19813. /**
  19814. * @description Global halo configuration
  19815. * @type {Halo}
  19816. */
  19817. halo: {
  19818. /**
  19819. * @description Whether to show halo
  19820. * @type {Boolean}
  19821. * @default show = false
  19822. */
  19823. show: false,
  19824. /**
  19825. * @description Halo animation duration (1s = 10)
  19826. * @type {[number, number]}
  19827. */
  19828. duration: [20, 30],
  19829. /**
  19830. * @description Halo color
  19831. * @type {String}
  19832. * @default color = '#fb7293'
  19833. */
  19834. color: '#fb7293',
  19835. /**
  19836. * @description Halo radius
  19837. * @type {Number}
  19838. * @default radius = 120
  19839. */
  19840. radius: 120
  19841. },
  19842. /**
  19843. * @description Global text configuration
  19844. * @type {Text}
  19845. */
  19846. text: {
  19847. /**
  19848. * @description Whether to show text
  19849. * @type {Boolean}
  19850. * @default show = false
  19851. */
  19852. show: false,
  19853. /**
  19854. * @description Text offset
  19855. * @type {[number, number]}
  19856. * @default offset = [0, 15]
  19857. */
  19858. offset: [0, 15],
  19859. /**
  19860. * @description Text color
  19861. * @type {String}
  19862. * @default color = '#ffdb5c'
  19863. */
  19864. color: '#ffdb5c',
  19865. /**
  19866. * @description Text font size
  19867. * @type {Number}
  19868. * @default fontSize = 12
  19869. */
  19870. fontSize: 12
  19871. },
  19872. /**
  19873. * @description Global icon configuration
  19874. * @type {Icon}
  19875. */
  19876. icon: {
  19877. /**
  19878. * @description Whether to show icon
  19879. * @type {Boolean}
  19880. * @default show = false
  19881. */
  19882. show: false,
  19883. /**
  19884. * @description Icon src
  19885. * @type {String}
  19886. * @default src = ''
  19887. */
  19888. src: '',
  19889. /**
  19890. * @description Icon width
  19891. * @type {Number}
  19892. * @default width = 15
  19893. */
  19894. width: 15,
  19895. /**
  19896. * @description Icon height
  19897. * @type {Number}
  19898. * @default width = 15
  19899. */
  19900. height: 15
  19901. },
  19902. /**
  19903. * @description Global line configuration
  19904. * @type {Line}
  19905. */
  19906. line: {
  19907. /**
  19908. * @description Line width
  19909. * @type {Number}
  19910. * @default width = 1
  19911. */
  19912. width: 1,
  19913. /**
  19914. * @description Flyline color
  19915. * @type {String}
  19916. * @default color = '#ffde93'
  19917. */
  19918. color: '#ffde93',
  19919. /**
  19920. * @description Orbit color
  19921. * @type {String}
  19922. * @default orbitColor = 'rgba(103, 224, 227, .2)'
  19923. */
  19924. orbitColor: 'rgba(103, 224, 227, .2)',
  19925. /**
  19926. * @description Flyline animation duration
  19927. * @type {[number, number]}
  19928. * @default duration = [20, 30]
  19929. */
  19930. duration: [20, 30],
  19931. /**
  19932. * @description Flyline radius
  19933. * @type {Number}
  19934. * @default radius = 100
  19935. */
  19936. radius: 100
  19937. },
  19938. /**
  19939. * @description Back ground image url
  19940. * @type {String}
  19941. * @default bgImgSrc = ''
  19942. */
  19943. bgImgSrc: '',
  19944. /**
  19945. * @description K value
  19946. * @type {Number}
  19947. * @default k = -0.5
  19948. * @example k = -1 ~ 1
  19949. */
  19950. k: -0.5,
  19951. /**
  19952. * @description Flyline curvature
  19953. * @type {Number}
  19954. * @default curvature = 5
  19955. */
  19956. curvature: 5,
  19957. /**
  19958. * @description Relative points position
  19959. * @type {Boolean}
  19960. * @default relative = true
  19961. */
  19962. relative: true
  19963. },
  19964. /**
  19965. * @description Fly line data
  19966. * @type {FlylineWithPath[]}
  19967. * @default flylines = []
  19968. */
  19969. flylines: [],
  19970. /**
  19971. * @description Fly line lengths
  19972. * @type {Number[]}
  19973. * @default flylineLengths = []
  19974. */
  19975. flylineLengths: [],
  19976. /**
  19977. * @description Fly line points
  19978. * @default flylinePoints = []
  19979. */
  19980. flylinePoints: [],
  19981. mergedConfig: null
  19982. };
  19983. },
  19984. watch: {
  19985. config() {
  19986. const {
  19987. calcData
  19988. } = this;
  19989. calcData();
  19990. }
  19991. },
  19992. methods: {
  19993. afterAutoResizeMixinInit() {
  19994. const {
  19995. calcData
  19996. } = this;
  19997. calcData();
  19998. },
  19999. onResize() {
  20000. const {
  20001. calcData
  20002. } = this;
  20003. calcData();
  20004. },
  20005. async calcData() {
  20006. const {
  20007. mergeConfig,
  20008. calcflylinePoints,
  20009. calcLinePaths
  20010. } = this;
  20011. mergeConfig();
  20012. calcflylinePoints();
  20013. calcLinePaths();
  20014. const {
  20015. calcLineLengths
  20016. } = this;
  20017. await calcLineLengths();
  20018. },
  20019. mergeConfig() {
  20020. let {
  20021. config,
  20022. defaultConfig
  20023. } = this;
  20024. const mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
  20025. const {
  20026. points,
  20027. lines,
  20028. halo,
  20029. text,
  20030. icon,
  20031. line
  20032. } = mergedConfig;
  20033. mergedConfig.points = points.map(item => {
  20034. item.halo = util_2$1(util_1(halo, true), item.halo || {});
  20035. item.text = util_2$1(util_1(text, true), item.text || {});
  20036. item.icon = util_2$1(util_1(icon, true), item.icon || {});
  20037. return item;
  20038. });
  20039. mergedConfig.lines = lines.map(item => {
  20040. return util_2$1(util_1(line, true), item);
  20041. });
  20042. this.mergedConfig = mergedConfig;
  20043. },
  20044. calcflylinePoints() {
  20045. const {
  20046. mergedConfig,
  20047. width,
  20048. height
  20049. } = this;
  20050. const {
  20051. relative,
  20052. points
  20053. } = mergedConfig;
  20054. this.flylinePoints = points.map((item, i) => {
  20055. const {
  20056. coordinate: [x, y],
  20057. halo,
  20058. icon,
  20059. text
  20060. } = item;
  20061. if (relative) item.coordinate = [x * width, y * height];
  20062. item.halo.time = randomExtend(...halo.duration) / 10;
  20063. const {
  20064. width: iw,
  20065. height: ih
  20066. } = icon;
  20067. item.icon.x = item.coordinate[0] - iw / 2;
  20068. item.icon.y = item.coordinate[1] - ih / 2;
  20069. const [ox, oy] = text.offset;
  20070. item.text.x = item.coordinate[0] + ox;
  20071. item.text.y = item.coordinate[1] + oy;
  20072. item.key = `${item.coordinate.toString()}${i}`;
  20073. return item;
  20074. });
  20075. },
  20076. calcLinePaths() {
  20077. const {
  20078. getPath,
  20079. mergedConfig
  20080. } = this;
  20081. const {
  20082. points,
  20083. lines
  20084. } = mergedConfig;
  20085. this.flylines = lines.map(item => {
  20086. const {
  20087. source,
  20088. target,
  20089. duration
  20090. } = item;
  20091. const sourcePoint = points.find(({
  20092. name
  20093. }) => name === source).coordinate;
  20094. const targetPoint = points.find(({
  20095. name
  20096. }) => name === target).coordinate;
  20097. const path = getPath(sourcePoint, targetPoint).map(item => item.map(v => parseFloat(v.toFixed(10))));
  20098. const d = `M${path[0].toString()} Q${path[1].toString()} ${path[2].toString()}`;
  20099. const key = `path${path.toString()}`;
  20100. const time = randomExtend(...duration) / 10;
  20101. return { ...item,
  20102. path,
  20103. key,
  20104. d,
  20105. time
  20106. };
  20107. });
  20108. },
  20109. getPath(start, end) {
  20110. const {
  20111. getControlPoint
  20112. } = this;
  20113. const controlPoint = getControlPoint(start, end);
  20114. return [start, controlPoint, end];
  20115. },
  20116. getControlPoint([sx, sy], [ex, ey]) {
  20117. const {
  20118. getKLinePointByx,
  20119. mergedConfig
  20120. } = this;
  20121. const {
  20122. curvature,
  20123. k
  20124. } = mergedConfig;
  20125. const [mx, my] = [(sx + ex) / 2, (sy + ey) / 2];
  20126. const distance = getPointDistance([sx, sy], [ex, ey]);
  20127. const targetLength = distance / curvature;
  20128. const disDived = targetLength / 2;
  20129. let [dx, dy] = [mx, my];
  20130. do {
  20131. dx += disDived;
  20132. dy = getKLinePointByx(k, [mx, my], dx)[1];
  20133. } while (getPointDistance([mx, my], [dx, dy]) < targetLength);
  20134. return [dx, dy];
  20135. },
  20136. getKLinePointByx(k, [lx, ly], x) {
  20137. const y = ly - k * lx + k * x;
  20138. return [x, y];
  20139. },
  20140. async calcLineLengths() {
  20141. const {
  20142. $nextTick,
  20143. flylines,
  20144. $refs
  20145. } = this;
  20146. await $nextTick();
  20147. this.flylineLengths = flylines.map(({
  20148. key
  20149. }) => $refs[key][0].getTotalLength());
  20150. },
  20151. consoleClickPos({
  20152. offsetX,
  20153. offsetY
  20154. }) {
  20155. const {
  20156. width,
  20157. height,
  20158. dev
  20159. } = this;
  20160. if (!dev) return;
  20161. const relativeX = (offsetX / width).toFixed(2);
  20162. const relativeY = (offsetY / height).toFixed(2);
  20163. console.warn(`dv-flyline-chart-enhanced DEV: \n Click Position is [${offsetX}, ${offsetY}] \n Relative Position is [${relativeX}, ${relativeY}]`);
  20164. }
  20165. }
  20166. };
  20167. /* script */
  20168. const __vue_script__$y = script$y;
  20169. /* template */
  20170. var __vue_render__$y = function() {
  20171. var _vm = this;
  20172. var _h = _vm.$createElement;
  20173. var _c = _vm._self._c || _h;
  20174. return _c(
  20175. "div",
  20176. {
  20177. ref: _vm.ref,
  20178. staticClass: "dv-flyline-chart-enhanced",
  20179. style:
  20180. "background-image: url(" +
  20181. (_vm.mergedConfig ? _vm.mergedConfig.bgImgSrc : "") +
  20182. ")",
  20183. on: { click: _vm.consoleClickPos }
  20184. },
  20185. [
  20186. _vm.flylines.length
  20187. ? _c(
  20188. "svg",
  20189. { attrs: { width: _vm.width, height: _vm.height } },
  20190. [
  20191. _c(
  20192. "defs",
  20193. [
  20194. _c(
  20195. "radialGradient",
  20196. {
  20197. attrs: {
  20198. id: _vm.flylineGradientId,
  20199. cx: "50%",
  20200. cy: "50%",
  20201. r: "50%"
  20202. }
  20203. },
  20204. [
  20205. _c("stop", {
  20206. attrs: {
  20207. offset: "0%",
  20208. "stop-color": "#fff",
  20209. "stop-opacity": "1"
  20210. }
  20211. }),
  20212. _vm._v(" "),
  20213. _c("stop", {
  20214. attrs: {
  20215. offset: "100%",
  20216. "stop-color": "#fff",
  20217. "stop-opacity": "0"
  20218. }
  20219. })
  20220. ],
  20221. 1
  20222. ),
  20223. _vm._v(" "),
  20224. _c(
  20225. "radialGradient",
  20226. {
  20227. attrs: {
  20228. id: _vm.haloGradientId,
  20229. cx: "50%",
  20230. cy: "50%",
  20231. r: "50%"
  20232. }
  20233. },
  20234. [
  20235. _c("stop", {
  20236. attrs: {
  20237. offset: "0%",
  20238. "stop-color": "#fff",
  20239. "stop-opacity": "0"
  20240. }
  20241. }),
  20242. _vm._v(" "),
  20243. _c("stop", {
  20244. attrs: {
  20245. offset: "100%",
  20246. "stop-color": "#fff",
  20247. "stop-opacity": "1"
  20248. }
  20249. })
  20250. ],
  20251. 1
  20252. )
  20253. ],
  20254. 1
  20255. ),
  20256. _vm._v(" "),
  20257. _vm._l(_vm.flylinePoints, function(point) {
  20258. return _c("g", { key: point.key + Math.random() }, [
  20259. _c("defs", [
  20260. point.halo.show
  20261. ? _c(
  20262. "circle",
  20263. {
  20264. attrs: {
  20265. id: "halo" + _vm.unique + point.key,
  20266. cx: point.coordinate[0],
  20267. cy: point.coordinate[1]
  20268. }
  20269. },
  20270. [
  20271. _c("animate", {
  20272. attrs: {
  20273. attributeName: "r",
  20274. values: "1;" + point.halo.radius,
  20275. dur: point.halo.time + "s",
  20276. repeatCount: "indefinite"
  20277. }
  20278. }),
  20279. _vm._v(" "),
  20280. _c("animate", {
  20281. attrs: {
  20282. attributeName: "opacity",
  20283. values: "1;0",
  20284. dur: point.halo.time + "s",
  20285. repeatCount: "indefinite"
  20286. }
  20287. })
  20288. ]
  20289. )
  20290. : _vm._e()
  20291. ]),
  20292. _vm._v(" "),
  20293. _c(
  20294. "mask",
  20295. { attrs: { id: "mask" + _vm.unique + point.key } },
  20296. [
  20297. point.halo.show
  20298. ? _c("use", {
  20299. attrs: {
  20300. "xlink:href": "#halo" + _vm.unique + point.key,
  20301. fill: "url(#" + _vm.haloGradientId + ")"
  20302. }
  20303. })
  20304. : _vm._e()
  20305. ]
  20306. ),
  20307. _vm._v(" "),
  20308. point.halo.show
  20309. ? _c("use", {
  20310. attrs: {
  20311. "xlink:href": "#halo" + _vm.unique + point.key,
  20312. fill: point.halo.color,
  20313. mask: "url(#mask" + _vm.unique + point.key + ")"
  20314. }
  20315. })
  20316. : _vm._e(),
  20317. _vm._v(" "),
  20318. point.icon.show
  20319. ? _c("image", {
  20320. attrs: {
  20321. "xlink:href": point.icon.src,
  20322. width: point.icon.width,
  20323. height: point.icon.height,
  20324. x: point.icon.x,
  20325. y: point.icon.y
  20326. }
  20327. })
  20328. : _vm._e(),
  20329. _vm._v(" "),
  20330. point.text.show
  20331. ? _c(
  20332. "text",
  20333. {
  20334. style:
  20335. "fontSize:" +
  20336. point.text.fontSize +
  20337. "px;color:" +
  20338. point.text.color,
  20339. attrs: {
  20340. fill: point.text.color,
  20341. x: point.text.x,
  20342. y: point.text.y
  20343. }
  20344. },
  20345. [_vm._v("\n " + _vm._s(point.name) + "\n ")]
  20346. )
  20347. : _vm._e()
  20348. ])
  20349. }),
  20350. _vm._v(" "),
  20351. _vm._l(_vm.flylines, function(line, i) {
  20352. return _c("g", { key: line.key + Math.random() }, [
  20353. _c("defs", [
  20354. _c("path", {
  20355. ref: line.key,
  20356. refInFor: true,
  20357. attrs: { id: line.key, d: line.d, fill: "transparent" }
  20358. })
  20359. ]),
  20360. _vm._v(" "),
  20361. _c("use", {
  20362. attrs: {
  20363. "xlink:href": "#" + line.key,
  20364. "stroke-width": line.width,
  20365. stroke: line.orbitColor
  20366. }
  20367. }),
  20368. _vm._v(" "),
  20369. _c(
  20370. "mask",
  20371. { attrs: { id: "mask" + _vm.unique + line.key } },
  20372. [
  20373. _c(
  20374. "circle",
  20375. {
  20376. attrs: {
  20377. cx: "0",
  20378. cy: "0",
  20379. r: line.radius,
  20380. fill: "url(#" + _vm.flylineGradientId + ")"
  20381. }
  20382. },
  20383. [
  20384. _c("animateMotion", {
  20385. attrs: {
  20386. dur: line.time,
  20387. path: line.d,
  20388. rotate: "auto",
  20389. repeatCount: "indefinite"
  20390. }
  20391. })
  20392. ],
  20393. 1
  20394. )
  20395. ]
  20396. ),
  20397. _vm._v(" "),
  20398. _vm.flylineLengths[i]
  20399. ? _c(
  20400. "use",
  20401. {
  20402. attrs: {
  20403. "xlink:href": "#" + line.key,
  20404. "stroke-width": line.width,
  20405. stroke: line.color,
  20406. mask: "url(#mask" + _vm.unique + line.key + ")"
  20407. }
  20408. },
  20409. [
  20410. _c("animate", {
  20411. attrs: {
  20412. attributeName: "stroke-dasharray",
  20413. from: "0, " + _vm.flylineLengths[i],
  20414. to: _vm.flylineLengths[i] + ", 0",
  20415. dur: line.time,
  20416. repeatCount: "indefinite"
  20417. }
  20418. })
  20419. ]
  20420. )
  20421. : _vm._e()
  20422. ])
  20423. })
  20424. ],
  20425. 2
  20426. )
  20427. : _vm._e()
  20428. ]
  20429. )
  20430. };
  20431. var __vue_staticRenderFns__$y = [];
  20432. __vue_render__$y._withStripped = true;
  20433. /* style */
  20434. const __vue_inject_styles__$y = function (inject) {
  20435. if (!inject) return
  20436. inject("data-v-a7b8c35c_0", { source: ".dv-flyline-chart-enhanced {\n display: flex;\n flex-direction: column;\n background-size: 100% 100%;\n}\n.dv-flyline-chart-enhanced text {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,sBAAsB;EACtB,0BAA0B;AAC5B;AACA;EACE,mBAAmB;EACnB,yBAAyB;AAC3B","file":"main.vue","sourcesContent":[".dv-flyline-chart-enhanced {\n display: flex;\n flex-direction: column;\n background-size: 100% 100%;\n}\n.dv-flyline-chart-enhanced text {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n"]}, media: undefined });
  20437. };
  20438. /* scoped */
  20439. const __vue_scope_id__$y = undefined;
  20440. /* module identifier */
  20441. const __vue_module_identifier__$y = undefined;
  20442. /* functional template */
  20443. const __vue_is_functional_template__$y = false;
  20444. /* style inject SSR */
  20445. /* style inject shadow dom */
  20446. const __vue_component__$y = /*#__PURE__*/normalizeComponent(
  20447. { render: __vue_render__$y, staticRenderFns: __vue_staticRenderFns__$y },
  20448. __vue_inject_styles__$y,
  20449. __vue_script__$y,
  20450. __vue_scope_id__$y,
  20451. __vue_is_functional_template__$y,
  20452. __vue_module_identifier__$y,
  20453. false,
  20454. createInjector,
  20455. undefined,
  20456. undefined
  20457. );
  20458. function flylineChartEnhanced (Vue) {
  20459. Vue.component(__vue_component__$y.name, __vue_component__$y);
  20460. }
  20461. //
  20462. var script$z = {
  20463. name: 'DvConicalColumnChart',
  20464. mixins: [autoResize],
  20465. props: {
  20466. config: {
  20467. type: Object,
  20468. default: () => ({})
  20469. }
  20470. },
  20471. data() {
  20472. return {
  20473. ref: 'conical-column-chart',
  20474. defaultConfig: {
  20475. /**
  20476. * @description Chart data
  20477. * @type {Array<Object>}
  20478. * @default data = []
  20479. */
  20480. data: [],
  20481. /**
  20482. * @description Chart img
  20483. * @type {Array<String>}
  20484. * @default img = []
  20485. */
  20486. img: [],
  20487. /**
  20488. * @description Chart font size
  20489. * @type {Number}
  20490. * @default fontSize = 12
  20491. */
  20492. fontSize: 12,
  20493. /**
  20494. * @description Img side length
  20495. * @type {Number}
  20496. * @default imgSideLength = 30
  20497. */
  20498. imgSideLength: 30,
  20499. /**
  20500. * @description Column color
  20501. * @type {String}
  20502. * @default columnColor = 'rgba(0, 194, 255, 0.4)'
  20503. */
  20504. columnColor: 'rgba(0, 194, 255, 0.4)',
  20505. /**
  20506. * @description Text color
  20507. * @type {String}
  20508. * @default textColor = '#fff'
  20509. */
  20510. textColor: '#fff',
  20511. /**
  20512. * @description Show value
  20513. * @type {Boolean}
  20514. * @default showValue = false
  20515. */
  20516. showValue: false
  20517. },
  20518. mergedConfig: null,
  20519. column: []
  20520. };
  20521. },
  20522. watch: {
  20523. config() {
  20524. const {
  20525. calcData
  20526. } = this;
  20527. calcData();
  20528. }
  20529. },
  20530. methods: {
  20531. afterAutoResizeMixinInit() {
  20532. const {
  20533. calcData
  20534. } = this;
  20535. calcData();
  20536. },
  20537. onResize() {
  20538. const {
  20539. calcData
  20540. } = this;
  20541. calcData();
  20542. },
  20543. calcData() {
  20544. const {
  20545. mergeConfig,
  20546. initData,
  20547. calcSVGPath
  20548. } = this;
  20549. mergeConfig();
  20550. initData();
  20551. calcSVGPath();
  20552. },
  20553. mergeConfig() {
  20554. const {
  20555. defaultConfig,
  20556. config
  20557. } = this;
  20558. this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
  20559. },
  20560. initData() {
  20561. const {
  20562. mergedConfig
  20563. } = this;
  20564. let {
  20565. data
  20566. } = mergedConfig;
  20567. data = util_1(data, true);
  20568. data.sort(({
  20569. value: a
  20570. }, {
  20571. value: b
  20572. }) => {
  20573. if (a > b) return -1;
  20574. if (a < b) return 1;
  20575. if (a === b) return 0;
  20576. });
  20577. const max = data[0] ? data[0].value : 10;
  20578. data = data.map(item => ({ ...item,
  20579. percent: item.value / max
  20580. }));
  20581. mergedConfig.data = data;
  20582. },
  20583. calcSVGPath() {
  20584. const {
  20585. mergedConfig,
  20586. width,
  20587. height
  20588. } = this;
  20589. const {
  20590. imgSideLength,
  20591. fontSize,
  20592. data
  20593. } = mergedConfig;
  20594. const itemNum = data.length;
  20595. const gap = width / (itemNum + 1);
  20596. const useAbleHeight = height - imgSideLength - fontSize - 5;
  20597. const svgBottom = height - fontSize - 5;
  20598. this.column = data.map((item, i) => {
  20599. const {
  20600. percent
  20601. } = item;
  20602. const middleXPos = gap * (i + 1);
  20603. const leftXPos = gap * i;
  20604. const rightXpos = gap * (i + 2);
  20605. const middleYPos = svgBottom - useAbleHeight * percent;
  20606. const controlYPos = useAbleHeight * percent * 0.6 + middleYPos;
  20607. const d = `
  20608. M${leftXPos}, ${svgBottom}
  20609. Q${middleXPos}, ${controlYPos} ${middleXPos},${middleYPos}
  20610. M${middleXPos},${middleYPos}
  20611. Q${middleXPos}, ${controlYPos} ${rightXpos},${svgBottom}
  20612. L${leftXPos}, ${svgBottom}
  20613. Z
  20614. `;
  20615. const textY = (svgBottom + middleYPos) / 2 + fontSize / 2;
  20616. return { ...item,
  20617. d,
  20618. x: middleXPos,
  20619. y: middleYPos,
  20620. textY
  20621. };
  20622. });
  20623. }
  20624. }
  20625. };
  20626. /* script */
  20627. const __vue_script__$z = script$z;
  20628. /* template */
  20629. var __vue_render__$z = function() {
  20630. var _vm = this;
  20631. var _h = _vm.$createElement;
  20632. var _c = _vm._self._c || _h;
  20633. return _c("div", { ref: _vm.ref, staticClass: "dv-conical-column-chart" }, [
  20634. _c(
  20635. "svg",
  20636. { attrs: { width: _vm.width, height: _vm.height } },
  20637. _vm._l(_vm.column, function(item, i) {
  20638. return _c("g", { key: i }, [
  20639. _c("path", {
  20640. attrs: { d: item.d, fill: _vm.mergedConfig.columnColor }
  20641. }),
  20642. _vm._v(" "),
  20643. _c(
  20644. "text",
  20645. {
  20646. style: "fontSize:" + _vm.mergedConfig.fontSize + "px",
  20647. attrs: {
  20648. fill: _vm.mergedConfig.textColor,
  20649. x: item.x,
  20650. y: _vm.height - 4
  20651. }
  20652. },
  20653. [_vm._v("\n " + _vm._s(item.name) + "\n ")]
  20654. ),
  20655. _vm._v(" "),
  20656. _vm.mergedConfig.img.length
  20657. ? _c("image", {
  20658. attrs: {
  20659. "xlink:href":
  20660. _vm.mergedConfig.img[i % _vm.mergedConfig.img.length],
  20661. width: _vm.mergedConfig.imgSideLength,
  20662. height: _vm.mergedConfig.imgSideLength,
  20663. x: item.x - _vm.mergedConfig.imgSideLength / 2,
  20664. y: item.y - _vm.mergedConfig.imgSideLength
  20665. }
  20666. })
  20667. : _vm._e(),
  20668. _vm._v(" "),
  20669. _vm.mergedConfig.showValue
  20670. ? _c(
  20671. "text",
  20672. {
  20673. style: "fontSize:" + _vm.mergedConfig.fontSize + "px",
  20674. attrs: {
  20675. fill: _vm.mergedConfig.textColor,
  20676. x: item.x,
  20677. y: item.textY
  20678. }
  20679. },
  20680. [_vm._v("\n " + _vm._s(item.value) + "\n ")]
  20681. )
  20682. : _vm._e()
  20683. ])
  20684. }),
  20685. 0
  20686. )
  20687. ])
  20688. };
  20689. var __vue_staticRenderFns__$z = [];
  20690. __vue_render__$z._withStripped = true;
  20691. /* style */
  20692. const __vue_inject_styles__$z = function (inject) {
  20693. if (!inject) return
  20694. inject("data-v-382f06c7_0", { source: ".dv-conical-column-chart {\n width: 100%;\n height: 100%;\n}\n.dv-conical-column-chart text {\n text-anchor: middle;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,mBAAmB;AACrB","file":"main.vue","sourcesContent":[".dv-conical-column-chart {\n width: 100%;\n height: 100%;\n}\n.dv-conical-column-chart text {\n text-anchor: middle;\n}\n"]}, media: undefined });
  20695. };
  20696. /* scoped */
  20697. const __vue_scope_id__$z = undefined;
  20698. /* module identifier */
  20699. const __vue_module_identifier__$z = undefined;
  20700. /* functional template */
  20701. const __vue_is_functional_template__$z = false;
  20702. /* style inject SSR */
  20703. /* style inject shadow dom */
  20704. const __vue_component__$z = /*#__PURE__*/normalizeComponent(
  20705. { render: __vue_render__$z, staticRenderFns: __vue_staticRenderFns__$z },
  20706. __vue_inject_styles__$z,
  20707. __vue_script__$z,
  20708. __vue_scope_id__$z,
  20709. __vue_is_functional_template__$z,
  20710. __vue_module_identifier__$z,
  20711. false,
  20712. createInjector,
  20713. undefined,
  20714. undefined
  20715. );
  20716. function conicalColumnChart (Vue) {
  20717. Vue.component(__vue_component__$z.name, __vue_component__$z);
  20718. }
  20719. function digitalFlop (Vue) {
  20720. Vue.component(__vue_component__$s.name, __vue_component__$s);
  20721. }
  20722. //
  20723. var script$A = {
  20724. name: 'DvScrollBoard',
  20725. mixins: [autoResize],
  20726. props: {
  20727. config: {
  20728. type: Object,
  20729. default: () => ({})
  20730. }
  20731. },
  20732. data() {
  20733. return {
  20734. ref: 'scroll-board',
  20735. defaultConfig: {
  20736. /**
  20737. * @description Board header
  20738. * @type {Array<String>}
  20739. * @default header = []
  20740. * @example header = ['column1', 'column2', 'column3']
  20741. */
  20742. header: [],
  20743. /**
  20744. * @description Board data
  20745. * @type {Array<Array>}
  20746. * @default data = []
  20747. */
  20748. data: [],
  20749. /**
  20750. * @description Row num
  20751. * @type {Number}
  20752. * @default rowNum = 5
  20753. */
  20754. rowNum: 5,
  20755. /**
  20756. * @description Header background color
  20757. * @type {String}
  20758. * @default headerBGC = '#00BAFF'
  20759. */
  20760. headerBGC: '#00BAFF',
  20761. /**
  20762. * @description Odd row background color
  20763. * @type {String}
  20764. * @default oddRowBGC = '#003B51'
  20765. */
  20766. oddRowBGC: '#003B51',
  20767. /**
  20768. * @description Even row background color
  20769. * @type {String}
  20770. * @default evenRowBGC = '#003B51'
  20771. */
  20772. evenRowBGC: '#0A2732',
  20773. /**
  20774. * @description Scroll wait time
  20775. * @type {Number}
  20776. * @default waitTime = 2000
  20777. */
  20778. waitTime: 2000,
  20779. /**
  20780. * @description Header height
  20781. * @type {Number}
  20782. * @default headerHeight = 35
  20783. */
  20784. headerHeight: 35,
  20785. /**
  20786. * @description Column width
  20787. * @type {Array<Number>}
  20788. * @default columnWidth = []
  20789. */
  20790. columnWidth: [],
  20791. /**
  20792. * @description Column align
  20793. * @type {Array<String>}
  20794. * @default align = []
  20795. * @example align = ['left', 'center', 'right']
  20796. */
  20797. align: [],
  20798. /**
  20799. * @description Show index
  20800. * @type {Boolean}
  20801. * @default index = false
  20802. */
  20803. index: false,
  20804. /**
  20805. * @description index Header
  20806. * @type {String}
  20807. * @default indexHeader = '#'
  20808. */
  20809. indexHeader: '#',
  20810. /**
  20811. * @description Carousel type
  20812. * @type {String}
  20813. * @default carousel = 'single'
  20814. * @example carousel = 'single' | 'page'
  20815. */
  20816. carousel: 'single',
  20817. /**
  20818. * @description Pause scroll when mouse hovered
  20819. * @type {Boolean}
  20820. * @default hoverPause = true
  20821. * @example hoverPause = true | false
  20822. */
  20823. hoverPause: true
  20824. },
  20825. mergedConfig: null,
  20826. header: [],
  20827. rowsData: [],
  20828. rows: [],
  20829. widths: [],
  20830. heights: [],
  20831. avgHeight: 0,
  20832. aligns: [],
  20833. animationIndex: 0,
  20834. animationHandler: '',
  20835. updater: 0,
  20836. needCalc: false
  20837. };
  20838. },
  20839. watch: {
  20840. config() {
  20841. const {
  20842. stopAnimation,
  20843. calcData
  20844. } = this;
  20845. stopAnimation();
  20846. this.animationIndex = 0;
  20847. calcData();
  20848. }
  20849. },
  20850. methods: {
  20851. handleHover(enter, ri, ci, row, ceil) {
  20852. const {
  20853. mergedConfig,
  20854. emitEvent,
  20855. stopAnimation,
  20856. animation
  20857. } = this;
  20858. if (enter) emitEvent('mouseover', ri, ci, row, ceil);
  20859. if (!mergedConfig.hoverPause) return;
  20860. if (enter) {
  20861. stopAnimation();
  20862. } else {
  20863. animation(true);
  20864. }
  20865. },
  20866. afterAutoResizeMixinInit() {
  20867. const {
  20868. calcData
  20869. } = this;
  20870. calcData();
  20871. },
  20872. onResize() {
  20873. const {
  20874. mergedConfig,
  20875. calcWidths,
  20876. calcHeights
  20877. } = this;
  20878. if (!mergedConfig) return;
  20879. calcWidths();
  20880. calcHeights();
  20881. },
  20882. calcData() {
  20883. const {
  20884. mergeConfig,
  20885. calcHeaderData,
  20886. calcRowsData
  20887. } = this;
  20888. mergeConfig();
  20889. calcHeaderData();
  20890. calcRowsData();
  20891. const {
  20892. calcWidths,
  20893. calcHeights,
  20894. calcAligns
  20895. } = this;
  20896. calcWidths();
  20897. calcHeights();
  20898. calcAligns();
  20899. const {
  20900. animation
  20901. } = this;
  20902. animation(true);
  20903. },
  20904. mergeConfig() {
  20905. let {
  20906. config,
  20907. defaultConfig
  20908. } = this;
  20909. this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
  20910. },
  20911. calcHeaderData() {
  20912. let {
  20913. header,
  20914. index,
  20915. indexHeader
  20916. } = this.mergedConfig;
  20917. if (!header.length) {
  20918. this.header = [];
  20919. return;
  20920. }
  20921. header = [...header];
  20922. if (index) header.unshift(indexHeader);
  20923. this.header = header;
  20924. },
  20925. calcRowsData() {
  20926. let {
  20927. data,
  20928. index,
  20929. headerBGC,
  20930. rowNum
  20931. } = this.mergedConfig;
  20932. if (index) {
  20933. data = data.map((row, i) => {
  20934. row = [...row];
  20935. const indexTag = `<span class="index" style="background-color: ${headerBGC};">${i + 1}</span>`;
  20936. row.unshift(indexTag);
  20937. return row;
  20938. });
  20939. }
  20940. data = data.map((ceils, i) => ({
  20941. ceils,
  20942. rowIndex: i
  20943. }));
  20944. const rowLength = data.length;
  20945. if (rowLength > rowNum && rowLength < 2 * rowNum) {
  20946. data = [...data, ...data];
  20947. }
  20948. data = data.map((d, i) => ({ ...d,
  20949. scroll: i
  20950. }));
  20951. this.rowsData = data;
  20952. this.rows = data;
  20953. },
  20954. calcWidths() {
  20955. const {
  20956. width,
  20957. mergedConfig,
  20958. rowsData
  20959. } = this;
  20960. const {
  20961. columnWidth,
  20962. header
  20963. } = mergedConfig;
  20964. const usedWidth = columnWidth.reduce((all, w) => all + w, 0);
  20965. let columnNum = 0;
  20966. if (rowsData[0]) {
  20967. columnNum = rowsData[0].ceils.length;
  20968. } else if (header.length) {
  20969. columnNum = header.length;
  20970. }
  20971. const avgWidth = (width - usedWidth) / (columnNum - columnWidth.length);
  20972. const widths = new Array(columnNum).fill(avgWidth);
  20973. this.widths = util_2$1(widths, columnWidth);
  20974. },
  20975. calcHeights(onresize = false) {
  20976. const {
  20977. height,
  20978. mergedConfig,
  20979. header
  20980. } = this;
  20981. const {
  20982. headerHeight,
  20983. rowNum,
  20984. data
  20985. } = mergedConfig;
  20986. let allHeight = height;
  20987. if (header.length) allHeight -= headerHeight;
  20988. const avgHeight = allHeight / rowNum;
  20989. this.avgHeight = avgHeight;
  20990. if (!onresize) this.heights = new Array(data.length).fill(avgHeight);
  20991. },
  20992. calcAligns() {
  20993. const {
  20994. header,
  20995. mergedConfig
  20996. } = this;
  20997. const columnNum = header.length;
  20998. let aligns = new Array(columnNum).fill('left');
  20999. const {
  21000. align
  21001. } = mergedConfig;
  21002. this.aligns = util_2$1(aligns, align);
  21003. },
  21004. async animation(start = false) {
  21005. const {
  21006. needCalc,
  21007. calcHeights,
  21008. calcRowsData
  21009. } = this;
  21010. if (needCalc) {
  21011. calcRowsData();
  21012. calcHeights();
  21013. this.needCalc = false;
  21014. }
  21015. let {
  21016. avgHeight,
  21017. animationIndex,
  21018. mergedConfig,
  21019. rowsData,
  21020. animation,
  21021. updater
  21022. } = this;
  21023. const {
  21024. waitTime,
  21025. carousel,
  21026. rowNum
  21027. } = mergedConfig;
  21028. const rowLength = rowsData.length;
  21029. if (rowNum >= rowLength) return;
  21030. if (start) {
  21031. await new Promise(resolve => setTimeout(resolve, waitTime));
  21032. if (updater !== this.updater) return;
  21033. }
  21034. const animationNum = carousel === 'single' ? 1 : rowNum;
  21035. let rows = rowsData.slice(animationIndex);
  21036. rows.push(...rowsData.slice(0, animationIndex));
  21037. this.rows = rows.slice(0, carousel === 'page' ? rowNum * 2 : rowNum + 1);
  21038. this.heights = new Array(rowLength).fill(avgHeight);
  21039. await new Promise(resolve => setTimeout(resolve, 300));
  21040. if (updater !== this.updater) return;
  21041. this.heights.splice(0, animationNum, ...new Array(animationNum).fill(0));
  21042. animationIndex += animationNum;
  21043. const back = animationIndex - rowLength;
  21044. if (back >= 0) animationIndex = back;
  21045. this.animationIndex = animationIndex;
  21046. this.$emit('scroll-change', animationIndex);
  21047. this.animationHandler = setTimeout(animation, waitTime - 300);
  21048. },
  21049. stopAnimation() {
  21050. const {
  21051. animationHandler,
  21052. updater
  21053. } = this;
  21054. this.updater = (updater + 1) % 999999;
  21055. if (!animationHandler) return;
  21056. clearTimeout(animationHandler);
  21057. },
  21058. emitEvent(type, ri, ci, row, ceil) {
  21059. const {
  21060. ceils,
  21061. rowIndex
  21062. } = row;
  21063. this.$emit(type, {
  21064. row: ceils,
  21065. ceil,
  21066. rowIndex,
  21067. columnIndex: ci
  21068. });
  21069. },
  21070. updateRows(rows, animationIndex) {
  21071. const {
  21072. mergedConfig,
  21073. animationHandler,
  21074. animation
  21075. } = this;
  21076. this.mergedConfig = { ...mergedConfig,
  21077. data: [...rows]
  21078. };
  21079. this.needCalc = true;
  21080. if (typeof animationIndex === 'number') this.animationIndex = animationIndex;
  21081. if (!animationHandler) animation(true);
  21082. }
  21083. },
  21084. destroyed() {
  21085. const {
  21086. stopAnimation
  21087. } = this;
  21088. stopAnimation();
  21089. }
  21090. };
  21091. /* script */
  21092. const __vue_script__$A = script$A;
  21093. /* template */
  21094. var __vue_render__$A = function() {
  21095. var _vm = this;
  21096. var _h = _vm.$createElement;
  21097. var _c = _vm._self._c || _h;
  21098. return _c("div", { ref: _vm.ref, staticClass: "dv-scroll-board" }, [
  21099. _vm.header.length && _vm.mergedConfig
  21100. ? _c(
  21101. "div",
  21102. {
  21103. staticClass: "header",
  21104. style: "background-color: " + _vm.mergedConfig.headerBGC + ";"
  21105. },
  21106. _vm._l(_vm.header, function(headerItem, i) {
  21107. return _c("div", {
  21108. key: "" + headerItem + i,
  21109. staticClass: "header-item",
  21110. style:
  21111. "\n height: " +
  21112. _vm.mergedConfig.headerHeight +
  21113. "px;\n line-height: " +
  21114. _vm.mergedConfig.headerHeight +
  21115. "px;\n width: " +
  21116. _vm.widths[i] +
  21117. "px;\n ",
  21118. attrs: { align: _vm.aligns[i] },
  21119. domProps: { innerHTML: _vm._s(headerItem) }
  21120. })
  21121. }),
  21122. 0
  21123. )
  21124. : _vm._e(),
  21125. _vm._v(" "),
  21126. _vm.mergedConfig
  21127. ? _c(
  21128. "div",
  21129. {
  21130. staticClass: "rows",
  21131. style:
  21132. "height: " +
  21133. (_vm.height -
  21134. (_vm.header.length ? _vm.mergedConfig.headerHeight : 0)) +
  21135. "px;"
  21136. },
  21137. _vm._l(_vm.rows, function(row, ri) {
  21138. return _c(
  21139. "div",
  21140. {
  21141. key: "" + row.toString() + row.scroll,
  21142. staticClass: "row-item",
  21143. style:
  21144. "\n height: " +
  21145. _vm.heights[ri] +
  21146. "px;\n line-height: " +
  21147. _vm.heights[ri] +
  21148. "px;\n background-color: " +
  21149. _vm.mergedConfig[
  21150. row.rowIndex % 2 === 0 ? "evenRowBGC" : "oddRowBGC"
  21151. ] +
  21152. ";\n "
  21153. },
  21154. _vm._l(row.ceils, function(ceil, ci) {
  21155. return _c("div", {
  21156. key: "" + ceil + ri + ci,
  21157. staticClass: "ceil",
  21158. style: "width: " + _vm.widths[ci] + "px;",
  21159. attrs: { align: _vm.aligns[ci] },
  21160. domProps: { innerHTML: _vm._s(ceil) },
  21161. on: {
  21162. click: function($event) {
  21163. return _vm.emitEvent("click", ri, ci, row, ceil)
  21164. },
  21165. mouseenter: function($event) {
  21166. return _vm.handleHover(true, ri, ci, row, ceil)
  21167. },
  21168. mouseleave: function($event) {
  21169. return _vm.handleHover(false)
  21170. }
  21171. }
  21172. })
  21173. }),
  21174. 0
  21175. )
  21176. }),
  21177. 0
  21178. )
  21179. : _vm._e()
  21180. ])
  21181. };
  21182. var __vue_staticRenderFns__$A = [];
  21183. __vue_render__$A._withStripped = true;
  21184. /* style */
  21185. const __vue_inject_styles__$A = function (inject) {
  21186. if (!inject) return
  21187. inject("data-v-26e19f4c_0", { source: ".dv-scroll-board {\n position: relative;\n width: 100%;\n height: 100%;\n color: #fff;\n}\n.dv-scroll-board .text {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .header {\n display: flex;\n flex-direction: row;\n font-size: 15px;\n}\n.dv-scroll-board .header .header-item {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows {\n overflow: hidden;\n}\n.dv-scroll-board .rows .row-item {\n display: flex;\n font-size: 14px;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows .ceil {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .rows .index {\n border-radius: 3px;\n padding: 0px 3px;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,WAAW;AACb;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;AACA;EACE,aAAa;EACb,mBAAmB;EACnB,eAAe;AACjB;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;EACvB,oBAAoB;AACtB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,aAAa;EACb,eAAe;EACf,oBAAoB;AACtB;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;AACA;EACE,kBAAkB;EAClB,gBAAgB;AAClB","file":"main.vue","sourcesContent":[".dv-scroll-board {\n position: relative;\n width: 100%;\n height: 100%;\n color: #fff;\n}\n.dv-scroll-board .text {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .header {\n display: flex;\n flex-direction: row;\n font-size: 15px;\n}\n.dv-scroll-board .header .header-item {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows {\n overflow: hidden;\n}\n.dv-scroll-board .rows .row-item {\n display: flex;\n font-size: 14px;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows .ceil {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .rows .index {\n border-radius: 3px;\n padding: 0px 3px;\n}\n"]}, media: undefined });
  21188. };
  21189. /* scoped */
  21190. const __vue_scope_id__$A = undefined;
  21191. /* module identifier */
  21192. const __vue_module_identifier__$A = undefined;
  21193. /* functional template */
  21194. const __vue_is_functional_template__$A = false;
  21195. /* style inject SSR */
  21196. /* style inject shadow dom */
  21197. const __vue_component__$A = /*#__PURE__*/normalizeComponent(
  21198. { render: __vue_render__$A, staticRenderFns: __vue_staticRenderFns__$A },
  21199. __vue_inject_styles__$A,
  21200. __vue_script__$A,
  21201. __vue_scope_id__$A,
  21202. __vue_is_functional_template__$A,
  21203. __vue_module_identifier__$A,
  21204. false,
  21205. createInjector,
  21206. undefined,
  21207. undefined
  21208. );
  21209. function scrollBoard (Vue) {
  21210. Vue.component(__vue_component__$A.name, __vue_component__$A);
  21211. }
  21212. //
  21213. var script$B = {
  21214. name: 'DvScrollRankingBoard',
  21215. mixins: [autoResize],
  21216. props: {
  21217. config: {
  21218. type: Object,
  21219. default: () => ({})
  21220. }
  21221. },
  21222. data() {
  21223. return {
  21224. ref: 'scroll-ranking-board',
  21225. defaultConfig: {
  21226. /**
  21227. * @description Board data
  21228. * @type {Array<Object>}
  21229. * @default data = []
  21230. */
  21231. data: [],
  21232. /**
  21233. * @description Row num
  21234. * @type {Number}
  21235. * @default rowNum = 5
  21236. */
  21237. rowNum: 5,
  21238. /**
  21239. * @description Scroll wait time
  21240. * @type {Number}
  21241. * @default waitTime = 2000
  21242. */
  21243. waitTime: 2000,
  21244. /**
  21245. * @description Carousel type
  21246. * @type {String}
  21247. * @default carousel = 'single'
  21248. * @example carousel = 'single' | 'page'
  21249. */
  21250. carousel: 'single',
  21251. /**
  21252. * @description Value unit
  21253. * @type {String}
  21254. * @default unit = ''
  21255. * @example unit = 'ton'
  21256. */
  21257. unit: '',
  21258. /**
  21259. * @description Auto sort by value
  21260. * @type {Boolean}
  21261. * @default sort = true
  21262. */
  21263. sort: true,
  21264. /**
  21265. * @description Value formatter
  21266. * @type {Function}
  21267. * @default valueFormatter = null
  21268. */
  21269. valueFormatter: null
  21270. },
  21271. mergedConfig: null,
  21272. rowsData: [],
  21273. rows: [],
  21274. heights: [],
  21275. animationIndex: 0,
  21276. animationHandler: '',
  21277. updater: 0
  21278. };
  21279. },
  21280. watch: {
  21281. config() {
  21282. const {
  21283. stopAnimation,
  21284. calcData
  21285. } = this;
  21286. stopAnimation();
  21287. calcData();
  21288. }
  21289. },
  21290. methods: {
  21291. afterAutoResizeMixinInit() {
  21292. const {
  21293. calcData
  21294. } = this;
  21295. calcData();
  21296. },
  21297. onResize() {
  21298. const {
  21299. mergedConfig,
  21300. calcHeights
  21301. } = this;
  21302. if (!mergedConfig) return;
  21303. calcHeights(true);
  21304. },
  21305. calcData() {
  21306. const {
  21307. mergeConfig,
  21308. calcRowsData
  21309. } = this;
  21310. mergeConfig();
  21311. calcRowsData();
  21312. const {
  21313. calcHeights
  21314. } = this;
  21315. calcHeights();
  21316. const {
  21317. animation
  21318. } = this;
  21319. animation(true);
  21320. },
  21321. mergeConfig() {
  21322. let {
  21323. config,
  21324. defaultConfig
  21325. } = this;
  21326. this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
  21327. },
  21328. calcRowsData() {
  21329. let {
  21330. data,
  21331. rowNum,
  21332. sort
  21333. } = this.mergedConfig;
  21334. sort && data.sort(({
  21335. value: a
  21336. }, {
  21337. value: b
  21338. }) => {
  21339. if (a > b) return -1;
  21340. if (a < b) return 1;
  21341. if (a === b) return 0;
  21342. });
  21343. const value = data.map(({
  21344. value
  21345. }) => value);
  21346. const min = Math.min(...value) || 0; // abs of min
  21347. const minAbs = Math.abs(min);
  21348. const max = Math.max(...value) || 0; // abs of max
  21349. const total = max + minAbs;
  21350. data = data.map((row, i) => ({ ...row,
  21351. ranking: i + 1,
  21352. percent: (row.value + minAbs) / total * 100
  21353. }));
  21354. const rowLength = data.length;
  21355. if (rowLength > rowNum && rowLength < 2 * rowNum) {
  21356. data = [...data, ...data];
  21357. }
  21358. data = data.map((d, i) => ({ ...d,
  21359. scroll: i
  21360. }));
  21361. this.rowsData = data;
  21362. this.rows = data;
  21363. },
  21364. calcHeights(onresize = false) {
  21365. const {
  21366. height,
  21367. mergedConfig
  21368. } = this;
  21369. const {
  21370. rowNum,
  21371. data
  21372. } = mergedConfig;
  21373. const avgHeight = height / rowNum;
  21374. this.avgHeight = avgHeight;
  21375. if (!onresize) this.heights = new Array(data.length).fill(avgHeight);
  21376. },
  21377. async animation(start = false) {
  21378. let {
  21379. avgHeight,
  21380. animationIndex,
  21381. mergedConfig,
  21382. rowsData,
  21383. animation,
  21384. updater
  21385. } = this;
  21386. const {
  21387. waitTime,
  21388. carousel,
  21389. rowNum
  21390. } = mergedConfig;
  21391. const rowLength = rowsData.length;
  21392. if (rowNum >= rowLength) return;
  21393. if (start) {
  21394. await new Promise(resolve => setTimeout(resolve, waitTime));
  21395. if (updater !== this.updater) return;
  21396. }
  21397. const animationNum = carousel === 'single' ? 1 : rowNum;
  21398. let rows = rowsData.slice(animationIndex);
  21399. rows.push(...rowsData.slice(0, animationIndex));
  21400. this.rows = rows.slice(0, rowNum + 1);
  21401. this.heights = new Array(rowLength).fill(avgHeight);
  21402. await new Promise(resolve => setTimeout(resolve, 300));
  21403. if (updater !== this.updater) return;
  21404. this.heights.splice(0, animationNum, ...new Array(animationNum).fill(0));
  21405. animationIndex += animationNum;
  21406. const back = animationIndex - rowLength;
  21407. if (back >= 0) animationIndex = back;
  21408. this.animationIndex = animationIndex;
  21409. this.animationHandler = setTimeout(animation, waitTime - 300);
  21410. },
  21411. stopAnimation() {
  21412. const {
  21413. animationHandler,
  21414. updater
  21415. } = this;
  21416. this.updater = (updater + 1) % 999999;
  21417. if (!animationHandler) return;
  21418. clearTimeout(animationHandler);
  21419. }
  21420. },
  21421. destroyed() {
  21422. const {
  21423. stopAnimation
  21424. } = this;
  21425. stopAnimation();
  21426. }
  21427. };
  21428. /* script */
  21429. const __vue_script__$B = script$B;
  21430. /* template */
  21431. var __vue_render__$B = function() {
  21432. var _vm = this;
  21433. var _h = _vm.$createElement;
  21434. var _c = _vm._self._c || _h;
  21435. return _c(
  21436. "div",
  21437. { ref: _vm.ref, staticClass: "dv-scroll-ranking-board" },
  21438. _vm._l(_vm.rows, function(item, i) {
  21439. return _c(
  21440. "div",
  21441. {
  21442. key: item.toString() + item.scroll,
  21443. staticClass: "row-item",
  21444. style: "height: " + _vm.heights[i] + "px;"
  21445. },
  21446. [
  21447. _c("div", { staticClass: "ranking-info" }, [
  21448. _c("div", { staticClass: "rank" }, [
  21449. _vm._v("No." + _vm._s(item.ranking))
  21450. ]),
  21451. _vm._v(" "),
  21452. _c("div", {
  21453. staticClass: "info-name",
  21454. domProps: { innerHTML: _vm._s(item.name) }
  21455. }),
  21456. _vm._v(" "),
  21457. _c("div", { staticClass: "ranking-value" }, [
  21458. _vm._v(
  21459. _vm._s(
  21460. _vm.mergedConfig.valueFormatter
  21461. ? _vm.mergedConfig.valueFormatter(item)
  21462. : item.value + _vm.mergedConfig.unit
  21463. )
  21464. )
  21465. ])
  21466. ]),
  21467. _vm._v(" "),
  21468. _c("div", { staticClass: "ranking-column" }, [
  21469. _c(
  21470. "div",
  21471. {
  21472. staticClass: "inside-column",
  21473. style: "width: " + item.percent + "%;"
  21474. },
  21475. [_c("div", { staticClass: "shine" })]
  21476. )
  21477. ])
  21478. ]
  21479. )
  21480. }),
  21481. 0
  21482. )
  21483. };
  21484. var __vue_staticRenderFns__$B = [];
  21485. __vue_render__$B._withStripped = true;
  21486. /* style */
  21487. const __vue_inject_styles__$B = function (inject) {
  21488. if (!inject) return
  21489. inject("data-v-f297519a_0", { source: ".dv-scroll-ranking-board {\n width: 100%;\n height: 100%;\n color: #fff;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .row-item {\n transition: all 0.3s;\n display: flex;\n flex-direction: column;\n justify-content: center;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .ranking-info {\n display: flex;\n width: 100%;\n font-size: 13px;\n}\n.dv-scroll-ranking-board .ranking-info .rank {\n width: 40px;\n color: #1370fb;\n}\n.dv-scroll-ranking-board .ranking-info .info-name {\n flex: 1;\n}\n.dv-scroll-ranking-board .ranking-column {\n border-bottom: 2px solid rgba(19, 112, 251, 0.5);\n margin-top: 5px;\n}\n.dv-scroll-ranking-board .ranking-column .inside-column {\n position: relative;\n height: 6px;\n background-color: #1370fb;\n margin-bottom: 2px;\n border-radius: 1px;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .ranking-column .shine {\n position: absolute;\n left: 0%;\n top: 2px;\n height: 2px;\n width: 50px;\n transform: translateX(-100%);\n background: radial-gradient(#28f8ff 5%, transparent 80%);\n animation: shine 3s ease-in-out infinite alternate;\n}\n@keyframes shine {\n80% {\n left: 0%;\n transform: translateX(-100%);\n}\n100% {\n left: 100%;\n transform: translateX(0%);\n}\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;EACZ,WAAW;EACX,gBAAgB;AAClB;AACA;EACE,oBAAoB;EACpB,aAAa;EACb,sBAAsB;EACtB,uBAAuB;EACvB,gBAAgB;AAClB;AACA;EACE,aAAa;EACb,WAAW;EACX,eAAe;AACjB;AACA;EACE,WAAW;EACX,cAAc;AAChB;AACA;EACE,OAAO;AACT;AACA;EACE,gDAAgD;EAChD,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,yBAAyB;EACzB,kBAAkB;EAClB,kBAAkB;EAClB,gBAAgB;AAClB;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,QAAQ;EACR,WAAW;EACX,WAAW;EACX,4BAA4B;EAC5B,wDAAwD;EACxD,kDAAkD;AACpD;AACA;AACE;IACE,QAAQ;IACR,4BAA4B;AAC9B;AACA;IACE,UAAU;IACV,yBAAyB;AAC3B;AACF","file":"main.vue","sourcesContent":[".dv-scroll-ranking-board {\n width: 100%;\n height: 100%;\n color: #fff;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .row-item {\n transition: all 0.3s;\n display: flex;\n flex-direction: column;\n justify-content: center;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .ranking-info {\n display: flex;\n width: 100%;\n font-size: 13px;\n}\n.dv-scroll-ranking-board .ranking-info .rank {\n width: 40px;\n color: #1370fb;\n}\n.dv-scroll-ranking-board .ranking-info .info-name {\n flex: 1;\n}\n.dv-scroll-ranking-board .ranking-column {\n border-bottom: 2px solid rgba(19, 112, 251, 0.5);\n margin-top: 5px;\n}\n.dv-scroll-ranking-board .ranking-column .inside-column {\n position: relative;\n height: 6px;\n background-color: #1370fb;\n margin-bottom: 2px;\n border-radius: 1px;\n overflow: hidden;\n}\n.dv-scroll-ranking-board .ranking-column .shine {\n position: absolute;\n left: 0%;\n top: 2px;\n height: 2px;\n width: 50px;\n transform: translateX(-100%);\n background: radial-gradient(#28f8ff 5%, transparent 80%);\n animation: shine 3s ease-in-out infinite alternate;\n}\n@keyframes shine {\n 80% {\n left: 0%;\n transform: translateX(-100%);\n }\n 100% {\n left: 100%;\n transform: translateX(0%);\n }\n}\n"]}, media: undefined });
  21490. };
  21491. /* scoped */
  21492. const __vue_scope_id__$B = undefined;
  21493. /* module identifier */
  21494. const __vue_module_identifier__$B = undefined;
  21495. /* functional template */
  21496. const __vue_is_functional_template__$B = false;
  21497. /* style inject SSR */
  21498. /* style inject shadow dom */
  21499. const __vue_component__$B = /*#__PURE__*/normalizeComponent(
  21500. { render: __vue_render__$B, staticRenderFns: __vue_staticRenderFns__$B },
  21501. __vue_inject_styles__$B,
  21502. __vue_script__$B,
  21503. __vue_scope_id__$B,
  21504. __vue_is_functional_template__$B,
  21505. __vue_module_identifier__$B,
  21506. false,
  21507. createInjector,
  21508. undefined,
  21509. undefined
  21510. );
  21511. function scrollRankingBoard (Vue) {
  21512. Vue.component(__vue_component__$B.name, __vue_component__$B);
  21513. }
  21514. /**
  21515. * IMPORT COMPONENTS
  21516. */
  21517. /**
  21518. * USE COMPONENTS
  21519. */
  21520. function datav (Vue) {
  21521. Vue.use(fullScreenContainer);
  21522. Vue.use(loading); // border box
  21523. Vue.use(borderBox1);
  21524. Vue.use(borderBox2);
  21525. Vue.use(borderBox3);
  21526. Vue.use(borderBox4);
  21527. Vue.use(borderBox5);
  21528. Vue.use(borderBox6);
  21529. Vue.use(borderBox7);
  21530. Vue.use(borderBox8);
  21531. Vue.use(borderBox9);
  21532. Vue.use(borderBox10);
  21533. Vue.use(borderBox11);
  21534. Vue.use(borderBox12);
  21535. Vue.use(borderBox13); // decoration
  21536. Vue.use(decoration1);
  21537. Vue.use(decoration2);
  21538. Vue.use(decoration3);
  21539. Vue.use(decoration4);
  21540. Vue.use(decoration5);
  21541. Vue.use(decoration6);
  21542. Vue.use(decoration7);
  21543. Vue.use(decoration8);
  21544. Vue.use(decoration9);
  21545. Vue.use(decoration10);
  21546. Vue.use(decoration11);
  21547. Vue.use(decoration12); // charts
  21548. Vue.use(charts);
  21549. Vue.use(activeRingChart);
  21550. Vue.use(capsuleChart);
  21551. Vue.use(waterLevelPond);
  21552. Vue.use(percentPond);
  21553. Vue.use(flylineChart);
  21554. Vue.use(flylineChartEnhanced);
  21555. Vue.use(conicalColumnChart);
  21556. Vue.use(digitalFlop);
  21557. Vue.use(scrollBoard);
  21558. Vue.use(scrollRankingBoard);
  21559. }
  21560. Vue.use(datav);
  21561. })));