datav.min.js 758 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252
  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. })));