123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252 |
- (function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('vue')) :
- typeof define === 'function' && define.amd ? define(['vue'], factory) :
- (global = global || self, factory(global.Vue));
- }(this, (function (Vue) { 'use strict';
-
- Vue = Vue && Object.prototype.hasOwnProperty.call(Vue, 'default') ? Vue['default'] : Vue;
-
- function randomExtend(minNum, maxNum) {
- if (arguments.length === 1) {
- return parseInt(Math.random() * minNum + 1, 10);
- } else {
- return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
- }
- }
- function debounce(delay, callback) {
- let lastTime;
- return function () {
- clearTimeout(lastTime);
- const [that, args] = [this, arguments];
- lastTime = setTimeout(() => {
- callback.apply(that, args);
- }, delay);
- };
- }
- function observerDomResize(dom, callback) {
- const MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
- const observer = new MutationObserver(callback);
- observer.observe(dom, {
- attributes: true,
- attributeFilter: ['style'],
- attributeOldValue: true
- });
- return observer;
- }
- function getPointDistance(pointOne, pointTwo) {
- const minusX = Math.abs(pointOne[0] - pointTwo[0]);
- const minusY = Math.abs(pointOne[1] - pointTwo[1]);
- return Math.sqrt(minusX * minusX + minusY * minusY);
- }
- function uuid(hasHyphen) {
- return (hasHyphen ? 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' : 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx').replace(/[xy]/g, function (c) {
- const r = Math.random() * 16 | 0;
- const v = c == 'x' ? r : r & 0x3 | 0x8;
- return v.toString(16);
- });
- }
-
- var autoResize = {
- data() {
- return {
- dom: '',
- width: 0,
- height: 0,
- debounceInitWHFun: '',
- domObserver: ''
- };
- },
-
- methods: {
- async autoResizeMixinInit() {
- const {
- initWH,
- getDebounceInitWHFun,
- bindDomResizeCallback,
- afterAutoResizeMixinInit
- } = this;
- await initWH(false);
- getDebounceInitWHFun();
- bindDomResizeCallback();
- if (typeof afterAutoResizeMixinInit === 'function') afterAutoResizeMixinInit();
- },
-
- initWH(resize = true) {
- const {
- $nextTick,
- $refs,
- ref,
- onResize
- } = this;
- return new Promise(resolve => {
- $nextTick(_ => {
- const dom = this.dom = $refs[ref];
- this.width = dom ? dom.clientWidth : 0;
- this.height = dom ? dom.clientHeight : 0;
-
- if (!dom) {
- console.warn('DataV: Failed to get dom node, component rendering may be abnormal!');
- } else if (!this.width || !this.height) {
- console.warn('DataV: Component width or height is 0px, rendering abnormality may occur!');
- }
-
- if (typeof onResize === 'function' && resize) onResize();
- resolve();
- });
- });
- },
-
- getDebounceInitWHFun() {
- const {
- initWH
- } = this;
- this.debounceInitWHFun = debounce(100, initWH);
- },
-
- bindDomResizeCallback() {
- const {
- dom,
- debounceInitWHFun
- } = this;
- this.domObserver = observerDomResize(dom, debounceInitWHFun);
- window.addEventListener('resize', debounceInitWHFun);
- },
-
- unbindDomResizeCallback() {
- let {
- domObserver,
- debounceInitWHFun
- } = this;
- if (!domObserver) return;
- domObserver.disconnect();
- domObserver.takeRecords();
- domObserver = null;
- window.removeEventListener('resize', debounceInitWHFun);
- }
-
- },
-
- mounted() {
- const {
- autoResizeMixinInit
- } = this;
- autoResizeMixinInit();
- },
-
- beforeDestroy() {
- const {
- unbindDomResizeCallback
- } = this;
- unbindDomResizeCallback();
- }
-
- };
-
- //
- var script = {
- name: 'DvFullScreenContainer',
- mixins: [autoResize],
-
- data() {
- return {
- ref: 'full-screen-container',
- allWidth: 0,
- scale: 0,
- datavRoot: '',
- ready: false
- };
- },
-
- methods: {
- afterAutoResizeMixinInit() {
- const {
- initConfig,
- setAppScale
- } = this;
- initConfig();
- setAppScale();
- this.ready = true;
- },
-
- initConfig() {
- const {
- dom
- } = this;
- const {
- width,
- height
- } = screen;
- this.allWidth = width;
- dom.style.width = `${width}px`;
- dom.style.height = `${height}px`;
- },
-
- setAppScale() {
- const {
- allWidth,
- dom
- } = this;
- const currentWidth = document.body.clientWidth;
- dom.style.transform = `scale(${currentWidth / allWidth})`;
- },
-
- onResize() {
- const {
- setAppScale
- } = this;
- setAppScale();
- }
-
- }
- };
-
- function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
- if (typeof shadowMode !== 'boolean') {
- createInjectorSSR = createInjector;
- createInjector = shadowMode;
- shadowMode = false;
- }
- // Vue.extend constructor export interop.
- const options = typeof script === 'function' ? script.options : script;
- // render functions
- if (template && template.render) {
- options.render = template.render;
- options.staticRenderFns = template.staticRenderFns;
- options._compiled = true;
- // functional template
- if (isFunctionalTemplate) {
- options.functional = true;
- }
- }
- // scopedId
- if (scopeId) {
- options._scopeId = scopeId;
- }
- let hook;
- if (moduleIdentifier) {
- // server build
- hook = function (context) {
- // 2.3 injection
- context =
- context || // cached call
- (this.$vnode && this.$vnode.ssrContext) || // stateful
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
- // 2.2 with runInNewContext: true
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
- context = __VUE_SSR_CONTEXT__;
- }
- // inject component styles
- if (style) {
- style.call(this, createInjectorSSR(context));
- }
- // register component module identifier for async chunk inference
- if (context && context._registeredComponents) {
- context._registeredComponents.add(moduleIdentifier);
- }
- };
- // used by ssr in case component is cached and beforeCreate
- // never gets called
- options._ssrRegister = hook;
- }
- else if (style) {
- hook = shadowMode
- ? function (context) {
- style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
- }
- : function (context) {
- style.call(this, createInjector(context));
- };
- }
- if (hook) {
- if (options.functional) {
- // register for functional component in vue file
- const originalRender = options.render;
- options.render = function renderWithStyleInjection(h, context) {
- hook.call(context);
- return originalRender(h, context);
- };
- }
- else {
- // inject component registration as beforeCreate hook
- const existing = options.beforeCreate;
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
- }
- }
- return script;
- }
-
- const isOldIE = typeof navigator !== 'undefined' &&
- /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
- function createInjector(context) {
- return (id, style) => addStyle(id, style);
- }
- let HEAD;
- const styles = {};
- function addStyle(id, css) {
- const group = isOldIE ? css.media || 'default' : id;
- const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });
- if (!style.ids.has(id)) {
- style.ids.add(id);
- let code = css.source;
- if (css.map) {
- // https://developer.chrome.com/devtools/docs/javascript-debugging
- // this makes source maps inside style tags work properly in Chrome
- code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
- // http://stackoverflow.com/a/26603875
- code +=
- '\n/*# sourceMappingURL=data:application/json;base64,' +
- btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
- ' */';
- }
- if (!style.element) {
- style.element = document.createElement('style');
- style.element.type = 'text/css';
- if (css.media)
- style.element.setAttribute('media', css.media);
- if (HEAD === undefined) {
- HEAD = document.head || document.getElementsByTagName('head')[0];
- }
- HEAD.appendChild(style.element);
- }
- if ('styleSheet' in style.element) {
- style.styles.push(code);
- style.element.styleSheet.cssText = style.styles
- .filter(Boolean)
- .join('\n');
- }
- else {
- const index = style.ids.size - 1;
- const textNode = document.createTextNode(code);
- const nodes = style.element.childNodes;
- if (nodes[index])
- style.element.removeChild(nodes[index]);
- if (nodes.length)
- style.element.insertBefore(textNode, nodes[index]);
- else
- style.element.appendChild(textNode);
- }
- }
- }
-
- /* script */
- const __vue_script__ = script;
-
- /* template */
- var __vue_render__ = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c(
- "div",
- { ref: _vm.ref, attrs: { id: "dv-full-screen-container" } },
- [_vm.ready ? [_vm._t("default")] : _vm._e()],
- 2
- )
- };
- var __vue_staticRenderFns__ = [];
- __vue_render__._withStripped = true;
-
- /* style */
- const __vue_inject_styles__ = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__ = undefined;
- /* module identifier */
- const __vue_module_identifier__ = undefined;
- /* functional template */
- const __vue_is_functional_template__ = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__ = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
- __vue_inject_styles__,
- __vue_script__,
- __vue_scope_id__,
- __vue_is_functional_template__,
- __vue_module_identifier__,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function fullScreenContainer (Vue) {
- Vue.component(__vue_component__.name, __vue_component__);
- }
-
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- var script$1 = {
- name: 'DvLoading'
- };
-
- /* script */
- const __vue_script__$1 = script$1;
-
- /* template */
- var __vue_render__$1 = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { staticClass: "dv-loading" }, [
- _c("svg", { attrs: { width: "50px", height: "50px" } }, [
- _c(
- "circle",
- {
- attrs: {
- cx: "25",
- cy: "25",
- r: "20",
- fill: "transparent",
- "stroke-width": "3",
- "stroke-dasharray": "31.415, 31.415",
- stroke: "#02bcfe",
- "stroke-linecap": "round"
- }
- },
- [
- _c("animateTransform", {
- attrs: {
- attributeName: "transform",
- type: "rotate",
- values: "0, 25 25;360, 25 25",
- dur: "1.5s",
- repeatCount: "indefinite"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "stroke",
- values: "#02bcfe;#3be6cb;#02bcfe",
- dur: "3s",
- repeatCount: "indefinite"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "circle",
- {
- attrs: {
- cx: "25",
- cy: "25",
- r: "10",
- fill: "transparent",
- "stroke-width": "3",
- "stroke-dasharray": "15.7, 15.7",
- stroke: "#3be6cb",
- "stroke-linecap": "round"
- }
- },
- [
- _c("animateTransform", {
- attrs: {
- attributeName: "transform",
- type: "rotate",
- values: "360, 25 25;0, 25 25",
- dur: "1.5s",
- repeatCount: "indefinite"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "stroke",
- values: "#3be6cb;#02bcfe;#3be6cb",
- dur: "3s",
- repeatCount: "indefinite"
- }
- })
- ],
- 1
- )
- ]),
- _vm._v(" "),
- _c("div", { staticClass: "loading-tip" }, [_vm._t("default")], 2)
- ])
- };
- var __vue_staticRenderFns__$1 = [];
- __vue_render__$1._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$1 = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$1 = undefined;
- /* module identifier */
- const __vue_module_identifier__$1 = undefined;
- /* functional template */
- const __vue_is_functional_template__$1 = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$1 = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
- __vue_inject_styles__$1,
- __vue_script__$1,
- __vue_scope_id__$1,
- __vue_is_functional_template__$1,
- __vue_module_identifier__$1,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function loading (Vue) {
- Vue.component(__vue_component__$1.name, __vue_component__$1);
- }
-
- function unwrapExports (x) {
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
- }
-
- function createCommonjsModule(fn, module) {
- return module = { exports: {} }, fn(module, module.exports), module.exports;
- }
-
- var interopRequireDefault = createCommonjsModule(function (module) {
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- };
- }
-
- module.exports = _interopRequireDefault;
- });
-
- unwrapExports(interopRequireDefault);
-
- function _arrayLikeToArray(arr, len) {
- if (len == null || len > arr.length) len = arr.length;
-
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
- arr2[i] = arr[i];
- }
-
- return arr2;
- }
-
- var arrayLikeToArray = _arrayLikeToArray;
-
- function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr)) return arrayLikeToArray(arr);
- }
-
- var arrayWithoutHoles = _arrayWithoutHoles;
-
- function _iterableToArray(iter) {
- if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
- }
-
- var iterableToArray = _iterableToArray;
-
- function _unsupportedIterableToArray(o, minLen) {
- if (!o) return;
- if (typeof o === "string") return arrayLikeToArray(o, minLen);
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if (n === "Object" && o.constructor) n = o.constructor.name;
- if (n === "Map" || n === "Set") return Array.from(o);
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
- }
-
- var unsupportedIterableToArray = _unsupportedIterableToArray;
-
- function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
-
- var nonIterableSpread = _nonIterableSpread;
-
- function _toConsumableArray(arr) {
- return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
- }
-
- var toConsumableArray = _toConsumableArray;
-
- var _typeof_1 = createCommonjsModule(function (module) {
- function _typeof(obj) {
- "@babel/helpers - typeof";
-
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
- module.exports = _typeof = function _typeof(obj) {
- return typeof obj;
- };
- } else {
- module.exports = _typeof = function _typeof(obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
- };
- }
-
- return _typeof(obj);
- }
-
- module.exports = _typeof;
- });
-
- function _arrayWithHoles(arr) {
- if (Array.isArray(arr)) return arr;
- }
-
- var arrayWithHoles = _arrayWithHoles;
-
- function _iterableToArrayLimit(arr, i) {
- if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = undefined;
-
- try {
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
-
- if (i && _arr.length === i) break;
- }
- } catch (err) {
- _d = true;
- _e = err;
- } finally {
- try {
- if (!_n && _i["return"] != null) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
-
- return _arr;
- }
-
- var iterableToArrayLimit = _iterableToArrayLimit;
-
- function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
-
- var nonIterableRest = _nonIterableRest;
-
- function _slicedToArray(arr, i) {
- return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
- }
-
- var slicedToArray = _slicedToArray;
-
- var util = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.deepClone = deepClone;
- exports.eliminateBlur = eliminateBlur;
- exports.checkPointIsInCircle = checkPointIsInCircle;
- exports.getTwoPointDistance = getTwoPointDistance;
- exports.checkPointIsInPolygon = checkPointIsInPolygon;
- exports.checkPointIsInSector = checkPointIsInSector;
- exports.checkPointIsNearPolyline = checkPointIsNearPolyline;
- exports.checkPointIsInRect = checkPointIsInRect;
- exports.getRotatePointPos = getRotatePointPos;
- exports.getScalePointPos = getScalePointPos;
- exports.getTranslatePointPos = getTranslatePointPos;
- exports.getDistanceBetweenPointAndLine = getDistanceBetweenPointAndLine;
- exports.getCircleRadianPoint = getCircleRadianPoint;
- exports.getRegularPolygonPoints = getRegularPolygonPoints;
- exports["default"] = void 0;
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
-
- var _typeof2 = interopRequireDefault(_typeof_1);
-
- var abs = Math.abs,
- sqrt = Math.sqrt,
- sin = Math.sin,
- cos = Math.cos,
- max = Math.max,
- min = Math.min,
- PI = Math.PI;
- /**
- * @description Clone an object or array
- * @param {Object|Array} object Cloned object
- * @param {Boolean} recursion Whether to use recursive cloning
- * @return {Object|Array} Clone object
- */
-
- function deepClone(object) {
- var recursion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- if (!object) return object;
- var parse = JSON.parse,
- stringify = JSON.stringify;
- if (!recursion) return parse(stringify(object));
- var clonedObj = object instanceof Array ? [] : {};
-
- if (object && (0, _typeof2["default"])(object) === 'object') {
- for (var key in object) {
- if (object.hasOwnProperty(key)) {
- if (object[key] && (0, _typeof2["default"])(object[key]) === 'object') {
- clonedObj[key] = deepClone(object[key], true);
- } else {
- clonedObj[key] = object[key];
- }
- }
- }
- }
-
- return clonedObj;
- }
- /**
- * @description Eliminate line blur due to 1px line width
- * @param {Array} points Line points
- * @return {Array} Line points after processed
- */
-
-
- function eliminateBlur(points) {
- return points.map(function (_ref) {
- var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
- x = _ref2[0],
- y = _ref2[1];
-
- return [parseInt(x) + 0.5, parseInt(y) + 0.5];
- });
- }
- /**
- * @description Check if the point is inside the circle
- * @param {Array} point Postion of point
- * @param {Number} rx Circle x coordinate
- * @param {Number} ry Circle y coordinate
- * @param {Number} r Circle radius
- * @return {Boolean} Result of check
- */
-
-
- function checkPointIsInCircle(point, rx, ry, r) {
- return getTwoPointDistance(point, [rx, ry]) <= r;
- }
- /**
- * @description Get the distance between two points
- * @param {Array} point1 point1
- * @param {Array} point2 point2
- * @return {Number} Distance between two points
- */
-
-
- function getTwoPointDistance(_ref3, _ref4) {
- var _ref5 = (0, _slicedToArray2["default"])(_ref3, 2),
- xa = _ref5[0],
- ya = _ref5[1];
-
- var _ref6 = (0, _slicedToArray2["default"])(_ref4, 2),
- xb = _ref6[0],
- yb = _ref6[1];
-
- var minusX = abs(xa - xb);
- var minusY = abs(ya - yb);
- return sqrt(minusX * minusX + minusY * minusY);
- }
- /**
- * @description Check if the point is inside the polygon
- * @param {Array} point Postion of point
- * @param {Array} points The points that makes up a polyline
- * @return {Boolean} Result of check
- */
-
-
- function checkPointIsInPolygon(point, polygon) {
- var counter = 0;
-
- var _point = (0, _slicedToArray2["default"])(point, 2),
- x = _point[0],
- y = _point[1];
-
- var pointNum = polygon.length;
-
- for (var i = 1, p1 = polygon[0]; i <= pointNum; i++) {
- var p2 = polygon[i % pointNum];
-
- if (x > min(p1[0], p2[0]) && x <= max(p1[0], p2[0])) {
- if (y <= max(p1[1], p2[1])) {
- if (p1[0] !== p2[0]) {
- var xinters = (x - p1[0]) * (p2[1] - p1[1]) / (p2[0] - p1[0]) + p1[1];
-
- if (p1[1] === p2[1] || y <= xinters) {
- counter++;
- }
- }
- }
- }
-
- p1 = p2;
- }
-
- return counter % 2 === 1;
- }
- /**
- * @description Check if the point is inside the sector
- * @param {Array} point Postion of point
- * @param {Number} rx Sector x coordinate
- * @param {Number} ry Sector y coordinate
- * @param {Number} r Sector radius
- * @param {Number} startAngle Sector start angle
- * @param {Number} endAngle Sector end angle
- * @param {Boolean} clockWise Whether the sector angle is clockwise
- * @return {Boolean} Result of check
- */
-
-
- function checkPointIsInSector(point, rx, ry, r, startAngle, endAngle, clockWise) {
- if (!point) return false;
- if (getTwoPointDistance(point, [rx, ry]) > r) return false;
-
- if (!clockWise) {
- var _deepClone = deepClone([endAngle, startAngle]);
-
- var _deepClone2 = (0, _slicedToArray2["default"])(_deepClone, 2);
-
- startAngle = _deepClone2[0];
- endAngle = _deepClone2[1];
- }
-
- var reverseBE = startAngle > endAngle;
-
- if (reverseBE) {
- var _ref7 = [endAngle, startAngle];
- startAngle = _ref7[0];
- endAngle = _ref7[1];
- }
-
- var minus = endAngle - startAngle;
- if (minus >= PI * 2) return true;
-
- var _point2 = (0, _slicedToArray2["default"])(point, 2),
- x = _point2[0],
- y = _point2[1];
-
- var _getCircleRadianPoint = getCircleRadianPoint(rx, ry, r, startAngle),
- _getCircleRadianPoint2 = (0, _slicedToArray2["default"])(_getCircleRadianPoint, 2),
- bx = _getCircleRadianPoint2[0],
- by = _getCircleRadianPoint2[1];
-
- var _getCircleRadianPoint3 = getCircleRadianPoint(rx, ry, r, endAngle),
- _getCircleRadianPoint4 = (0, _slicedToArray2["default"])(_getCircleRadianPoint3, 2),
- ex = _getCircleRadianPoint4[0],
- ey = _getCircleRadianPoint4[1];
-
- var vPoint = [x - rx, y - ry];
- var vBArm = [bx - rx, by - ry];
- var vEArm = [ex - rx, ey - ry];
- var reverse = minus > PI;
-
- if (reverse) {
- var _deepClone3 = deepClone([vEArm, vBArm]);
-
- var _deepClone4 = (0, _slicedToArray2["default"])(_deepClone3, 2);
-
- vBArm = _deepClone4[0];
- vEArm = _deepClone4[1];
- }
-
- var inSector = isClockWise(vBArm, vPoint) && !isClockWise(vEArm, vPoint);
- if (reverse) inSector = !inSector;
- if (reverseBE) inSector = !inSector;
- return inSector;
- }
- /**
- * @description Determine if the point is in the clockwise direction of the vector
- * @param {Array} vArm Vector
- * @param {Array} vPoint Point
- * @return {Boolean} Result of check
- */
-
-
- function isClockWise(vArm, vPoint) {
- var _vArm = (0, _slicedToArray2["default"])(vArm, 2),
- ax = _vArm[0],
- ay = _vArm[1];
-
- var _vPoint = (0, _slicedToArray2["default"])(vPoint, 2),
- px = _vPoint[0],
- py = _vPoint[1];
-
- return -ay * px + ax * py > 0;
- }
- /**
- * @description Check if the point is inside the polyline
- * @param {Array} point Postion of point
- * @param {Array} polyline The points that makes up a polyline
- * @param {Number} lineWidth Polyline linewidth
- * @return {Boolean} Result of check
- */
-
-
- function checkPointIsNearPolyline(point, polyline, lineWidth) {
- var halfLineWidth = lineWidth / 2;
- var moveUpPolyline = polyline.map(function (_ref8) {
- var _ref9 = (0, _slicedToArray2["default"])(_ref8, 2),
- x = _ref9[0],
- y = _ref9[1];
-
- return [x, y - halfLineWidth];
- });
- var moveDownPolyline = polyline.map(function (_ref10) {
- var _ref11 = (0, _slicedToArray2["default"])(_ref10, 2),
- x = _ref11[0],
- y = _ref11[1];
-
- return [x, y + halfLineWidth];
- });
- var polygon = [].concat((0, _toConsumableArray2["default"])(moveUpPolyline), (0, _toConsumableArray2["default"])(moveDownPolyline.reverse()));
- return checkPointIsInPolygon(point, polygon);
- }
- /**
- * @description Check if the point is inside the rect
- * @param {Array} point Postion of point
- * @param {Number} x Rect start x coordinate
- * @param {Number} y Rect start y coordinate
- * @param {Number} width Rect width
- * @param {Number} height Rect height
- * @return {Boolean} Result of check
- */
-
-
- function checkPointIsInRect(_ref12, x, y, width, height) {
- var _ref13 = (0, _slicedToArray2["default"])(_ref12, 2),
- px = _ref13[0],
- py = _ref13[1];
-
- if (px < x) return false;
- if (py < y) return false;
- if (px > x + width) return false;
- if (py > y + height) return false;
- return true;
- }
- /**
- * @description Get the coordinates of the rotated point
- * @param {Number} rotate Degree of rotation
- * @param {Array} point Postion of point
- * @param {Array} origin Rotation center
- * @param {Array} origin Rotation center
- * @return {Number} Coordinates after rotation
- */
-
-
- function getRotatePointPos() {
- var rotate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- var point = arguments.length > 1 ? arguments[1] : undefined;
- var origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0];
- if (!point) return false;
- if (rotate % 360 === 0) return point;
-
- var _point3 = (0, _slicedToArray2["default"])(point, 2),
- x = _point3[0],
- y = _point3[1];
-
- var _origin = (0, _slicedToArray2["default"])(origin, 2),
- ox = _origin[0],
- oy = _origin[1];
-
- rotate *= PI / 180;
- return [(x - ox) * cos(rotate) - (y - oy) * sin(rotate) + ox, (x - ox) * sin(rotate) + (y - oy) * cos(rotate) + oy];
- }
- /**
- * @description Get the coordinates of the scaled point
- * @param {Array} scale Scale factor
- * @param {Array} point Postion of point
- * @param {Array} origin Scale center
- * @return {Number} Coordinates after scale
- */
-
-
- function getScalePointPos() {
- var scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [1, 1];
- var point = arguments.length > 1 ? arguments[1] : undefined;
- var origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0];
- if (!point) return false;
- if (scale === 1) return point;
-
- var _point4 = (0, _slicedToArray2["default"])(point, 2),
- x = _point4[0],
- y = _point4[1];
-
- var _origin2 = (0, _slicedToArray2["default"])(origin, 2),
- ox = _origin2[0],
- oy = _origin2[1];
-
- var _scale = (0, _slicedToArray2["default"])(scale, 2),
- xs = _scale[0],
- ys = _scale[1];
-
- var relativePosX = x - ox;
- var relativePosY = y - oy;
- return [relativePosX * xs + ox, relativePosY * ys + oy];
- }
- /**
- * @description Get the coordinates of the scaled point
- * @param {Array} translate Translation distance
- * @param {Array} point Postion of point
- * @return {Number} Coordinates after translation
- */
-
-
- function getTranslatePointPos(translate, point) {
- if (!translate || !point) return false;
-
- var _point5 = (0, _slicedToArray2["default"])(point, 2),
- x = _point5[0],
- y = _point5[1];
-
- var _translate = (0, _slicedToArray2["default"])(translate, 2),
- tx = _translate[0],
- ty = _translate[1];
-
- return [x + tx, y + ty];
- }
- /**
- * @description Get the distance from the point to the line
- * @param {Array} point Postion of point
- * @param {Array} lineBegin Line start position
- * @param {Array} lineEnd Line end position
- * @return {Number} Distance between point and line
- */
-
-
- function getDistanceBetweenPointAndLine(point, lineBegin, lineEnd) {
- if (!point || !lineBegin || !lineEnd) return false;
-
- var _point6 = (0, _slicedToArray2["default"])(point, 2),
- x = _point6[0],
- y = _point6[1];
-
- var _lineBegin = (0, _slicedToArray2["default"])(lineBegin, 2),
- x1 = _lineBegin[0],
- y1 = _lineBegin[1];
-
- var _lineEnd = (0, _slicedToArray2["default"])(lineEnd, 2),
- x2 = _lineEnd[0],
- y2 = _lineEnd[1];
-
- var a = y2 - y1;
- var b = x1 - x2;
- var c = y1 * (x2 - x1) - x1 * (y2 - y1);
- var molecule = abs(a * x + b * y + c);
- var denominator = sqrt(a * a + b * b);
- return molecule / denominator;
- }
- /**
- * @description Get the coordinates of the specified radian on the circle
- * @param {Number} x Circle x coordinate
- * @param {Number} y Circle y coordinate
- * @param {Number} radius Circle radius
- * @param {Number} radian Specfied radian
- * @return {Array} Postion of point
- */
-
-
- function getCircleRadianPoint(x, y, radius, radian) {
- return [x + cos(radian) * radius, y + sin(radian) * radius];
- }
- /**
- * @description Get the points that make up a regular polygon
- * @param {Number} x X coordinate of the polygon inscribed circle
- * @param {Number} y Y coordinate of the polygon inscribed circle
- * @param {Number} r Radius of the polygon inscribed circle
- * @param {Number} side Side number
- * @param {Number} minus Radian offset
- * @return {Array} Points that make up a regular polygon
- */
-
-
- function getRegularPolygonPoints(rx, ry, r, side) {
- var minus = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : PI * -0.5;
- var radianGap = PI * 2 / side;
- var radians = new Array(side).fill('').map(function (t, i) {
- return i * radianGap + minus;
- });
- return radians.map(function (radian) {
- return getCircleRadianPoint(rx, ry, r, radian);
- });
- }
-
- var _default = {
- deepClone: deepClone,
- eliminateBlur: eliminateBlur,
- checkPointIsInCircle: checkPointIsInCircle,
- checkPointIsInPolygon: checkPointIsInPolygon,
- checkPointIsInSector: checkPointIsInSector,
- checkPointIsNearPolyline: checkPointIsNearPolyline,
- getTwoPointDistance: getTwoPointDistance,
- getRotatePointPos: getRotatePointPos,
- getScalePointPos: getScalePointPos,
- getTranslatePointPos: getTranslatePointPos,
- getCircleRadianPoint: getCircleRadianPoint,
- getRegularPolygonPoints: getRegularPolygonPoints,
- getDistanceBetweenPointAndLine: getDistanceBetweenPointAndLine
- };
- exports["default"] = _default;
- });
-
- unwrapExports(util);
- var util_1 = util.deepClone;
- var util_2 = util.eliminateBlur;
- var util_3 = util.checkPointIsInCircle;
- var util_4 = util.getTwoPointDistance;
- var util_5 = util.checkPointIsInPolygon;
- var util_6 = util.checkPointIsInSector;
- var util_7 = util.checkPointIsNearPolyline;
- var util_8 = util.checkPointIsInRect;
- var util_9 = util.getRotatePointPos;
- var util_10 = util.getScalePointPos;
- var util_11 = util.getTranslatePointPos;
- var util_12 = util.getDistanceBetweenPointAndLine;
- var util_13 = util.getCircleRadianPoint;
- var util_14 = util.getRegularPolygonPoints;
-
- var util$1 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.filterNonNumber = filterNonNumber;
- exports.deepMerge = deepMerge;
- exports.mulAdd = mulAdd;
- exports.mergeSameStackData = mergeSameStackData;
- exports.getTwoPointDistance = getTwoPointDistance;
- exports.getLinearGradientColor = getLinearGradientColor;
- exports.getPolylineLength = getPolylineLength;
- exports.getPointToLineDistance = getPointToLineDistance;
- exports.initNeedSeries = initNeedSeries;
- exports.radianToAngle = radianToAngle;
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
- var _typeof2 = interopRequireDefault(_typeof_1);
-
-
-
- function filterNonNumber(array) {
- return array.filter(function (n) {
- return typeof n === 'number';
- });
- }
-
- function deepMerge(target, merged) {
- for (var key in merged) {
- if (target[key] && (0, _typeof2["default"])(target[key]) === 'object') {
- deepMerge(target[key], merged[key]);
- continue;
- }
-
- if ((0, _typeof2["default"])(merged[key]) === 'object') {
- target[key] = (0, util.deepClone)(merged[key], true);
- continue;
- }
-
- target[key] = merged[key];
- }
-
- return target;
- }
-
- function mulAdd(nums) {
- nums = filterNonNumber(nums);
- return nums.reduce(function (all, num) {
- return all + num;
- }, 0);
- }
-
- function mergeSameStackData(item, series) {
- var stack = item.stack;
- if (!stack) return (0, _toConsumableArray2["default"])(item.data);
- var stacks = series.filter(function (_ref) {
- var s = _ref.stack;
- return s === stack;
- });
- var index = stacks.findIndex(function (_ref2) {
- var d = _ref2.data;
- return d === item.data;
- });
- var datas = stacks.splice(0, index + 1).map(function (_ref3) {
- var data = _ref3.data;
- return data;
- });
- var dataLength = datas[0].length;
- return new Array(dataLength).fill(0).map(function (foo, i) {
- return mulAdd(datas.map(function (d) {
- return d[i];
- }));
- });
- }
-
- function getTwoPointDistance(pointOne, pointTwo) {
- var minusX = Math.abs(pointOne[0] - pointTwo[0]);
- var minusY = Math.abs(pointOne[1] - pointTwo[1]);
- return Math.sqrt(minusX * minusX + minusY * minusY);
- }
-
- function getLinearGradientColor(ctx, begin, end, color) {
- if (!ctx || !begin || !end || !color.length) return;
- var colors = color;
- typeof colors === 'string' && (colors = [color, color]);
- var linearGradientColor = ctx.createLinearGradient.apply(ctx, (0, _toConsumableArray2["default"])(begin).concat((0, _toConsumableArray2["default"])(end)));
- var colorGap = 1 / (colors.length - 1);
- colors.forEach(function (c, i) {
- return linearGradientColor.addColorStop(colorGap * i, c);
- });
- return linearGradientColor;
- }
-
- function getPolylineLength(points) {
- var lineSegments = new Array(points.length - 1).fill(0).map(function (foo, i) {
- return [points[i], points[i + 1]];
- });
- var lengths = lineSegments.map(function (item) {
- return getTwoPointDistance.apply(void 0, (0, _toConsumableArray2["default"])(item));
- });
- return mulAdd(lengths);
- }
-
- function getPointToLineDistance(point, linePointOne, linePointTwo) {
- var a = getTwoPointDistance(point, linePointOne);
- var b = getTwoPointDistance(point, linePointTwo);
- var c = getTwoPointDistance(linePointOne, linePointTwo);
- return 0.5 * Math.sqrt((a + b + c) * (a + b - c) * (a + c - b) * (b + c - a)) / c;
- }
-
- function initNeedSeries(series, config, type) {
- series = series.filter(function (_ref4) {
- var st = _ref4.type;
- return st === type;
- });
- series = series.map(function (item) {
- return deepMerge((0, util.deepClone)(config, true), item);
- });
- return series.filter(function (_ref5) {
- var show = _ref5.show;
- return show;
- });
- }
-
- function radianToAngle(radian) {
- return radian / Math.PI * 180;
- }
- });
-
- unwrapExports(util$1);
- var util_1$1 = util$1.filterNonNumber;
- var util_2$1 = util$1.deepMerge;
- var util_3$1 = util$1.mulAdd;
- var util_4$1 = util$1.mergeSameStackData;
- var util_5$1 = util$1.getTwoPointDistance;
- var util_6$1 = util$1.getLinearGradientColor;
- var util_7$1 = util$1.getPolylineLength;
- var util_8$1 = util$1.getPointToLineDistance;
- var util_9$1 = util$1.initNeedSeries;
- var util_10$1 = util$1.radianToAngle;
-
- //
- var script$2 = {
- name: 'DvBorderBox1',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- backgroundColor: {
- type: String,
- default: 'transparent'
- }
- },
-
- data() {
- return {
- ref: 'border-box-1',
- border: ['left-top', 'right-top', 'left-bottom', 'right-bottom'],
- defaultColor: ['#4fd2dd', '#235fa7'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$2 = script$2;
-
- /* template */
- var __vue_render__$2 = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c(
- "div",
- { ref: _vm.ref, staticClass: "dv-border-box-1" },
- [
- _c(
- "svg",
- {
- staticClass: "border",
- attrs: { width: _vm.width, height: _vm.height }
- },
- [
- _c("polygon", {
- attrs: {
- fill: _vm.backgroundColor,
- points:
- "10, 27 10, " +
- (_vm.height - 27) +
- " 13, " +
- (_vm.height - 24) +
- " 13, " +
- (_vm.height - 21) +
- " 24, " +
- (_vm.height - 11) +
- "\n 38, " +
- (_vm.height - 11) +
- " 41, " +
- (_vm.height - 8) +
- " 73, " +
- (_vm.height - 8) +
- " 75, " +
- (_vm.height - 10) +
- " 81, " +
- (_vm.height - 10) +
- "\n 85, " +
- (_vm.height - 6) +
- " " +
- (_vm.width - 85) +
- ", " +
- (_vm.height - 6) +
- " " +
- (_vm.width - 81) +
- ", " +
- (_vm.height - 10) +
- " " +
- (_vm.width - 75) +
- ", " +
- (_vm.height - 10) +
- "\n " +
- (_vm.width - 73) +
- ", " +
- (_vm.height - 8) +
- " " +
- (_vm.width - 41) +
- ", " +
- (_vm.height - 8) +
- " " +
- (_vm.width - 38) +
- ", " +
- (_vm.height - 11) +
- "\n " +
- (_vm.width - 24) +
- ", " +
- (_vm.height - 11) +
- " " +
- (_vm.width - 13) +
- ", " +
- (_vm.height - 21) +
- " " +
- (_vm.width - 13) +
- ", " +
- (_vm.height - 24) +
- "\n " +
- (_vm.width - 10) +
- ", " +
- (_vm.height - 27) +
- " " +
- (_vm.width - 10) +
- ", 27 " +
- (_vm.width - 13) +
- ", 25 " +
- (_vm.width - 13) +
- ", 21\n " +
- (_vm.width - 24) +
- ", 11 " +
- (_vm.width - 38) +
- ", 11 " +
- (_vm.width - 41) +
- ", 8 " +
- (_vm.width - 73) +
- ", 8 " +
- (_vm.width - 75) +
- ", 10\n " +
- (_vm.width - 81) +
- ", 10 " +
- (_vm.width - 85) +
- ", 6 85, 6 81, 10 75, 10 73, 8 41, 8 38, 11 24, 11 13, 21 13, 24"
- }
- })
- ]
- ),
- _vm._v(" "),
- _vm._l(_vm.border, function(item) {
- return _c(
- "svg",
- {
- key: item,
- class: item + " border",
- attrs: { width: "150px", height: "150px" }
- },
- [
- _c(
- "polygon",
- {
- attrs: {
- fill: _vm.mergedColor[0],
- points:
- "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"
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "fill",
- values:
- _vm.mergedColor[0] +
- ";" +
- _vm.mergedColor[1] +
- ";" +
- _vm.mergedColor[0],
- dur: "0.5s",
- begin: "0s",
- repeatCount: "indefinite"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "polygon",
- {
- attrs: {
- fill: _vm.mergedColor[1],
- points:
- "27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8"
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "fill",
- values:
- _vm.mergedColor[1] +
- ";" +
- _vm.mergedColor[0] +
- ";" +
- _vm.mergedColor[1],
- dur: "0.5s",
- begin: "0s",
- repeatCount: "indefinite"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "polygon",
- {
- attrs: {
- fill: _vm.mergedColor[0],
- points:
- "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"
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "fill",
- values:
- _vm.mergedColor[0] +
- ";" +
- _vm.mergedColor[1] +
- ";transparent",
- dur: "1s",
- begin: "0s",
- repeatCount: "indefinite"
- }
- })
- ]
- )
- ]
- )
- }),
- _vm._v(" "),
- _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
- ],
- 2
- )
- };
- var __vue_staticRenderFns__$2 = [];
- __vue_render__$2._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$2 = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$2 = undefined;
- /* module identifier */
- const __vue_module_identifier__$2 = undefined;
- /* functional template */
- const __vue_is_functional_template__$2 = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$2 = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
- __vue_inject_styles__$2,
- __vue_script__$2,
- __vue_scope_id__$2,
- __vue_is_functional_template__$2,
- __vue_module_identifier__$2,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function borderBox1 (Vue) {
- Vue.component(__vue_component__$2.name, __vue_component__$2);
- }
-
- //
- var script$3 = {
- name: 'DvBorderBox2',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- backgroundColor: {
- type: String,
- default: 'transparent'
- }
- },
-
- data() {
- return {
- ref: 'border-box-2',
- defaultColor: ['#fff', 'rgba(255, 255, 255, 0.6)'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$3 = script$3;
-
- /* template */
- var __vue_render__$3 = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-2" }, [
- _c(
- "svg",
- {
- staticClass: "dv-border-svg-container",
- attrs: { width: _vm.width, height: _vm.height }
- },
- [
- _c("polygon", {
- attrs: {
- fill: _vm.backgroundColor,
- points:
- "\n 7, 7 " +
- (_vm.width - 7) +
- ", 7 " +
- (_vm.width - 7) +
- ", " +
- (_vm.height - 7) +
- " 7, " +
- (_vm.height - 7) +
- "\n "
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[0],
- points:
- "2, 2 " +
- (_vm.width - 2) +
- " ,2 " +
- (_vm.width - 2) +
- ", " +
- (_vm.height - 2) +
- " 2, " +
- (_vm.height - 2) +
- " 2, 2"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[1],
- points:
- "6, 6 " +
- (_vm.width - 6) +
- ", 6 " +
- (_vm.width - 6) +
- ", " +
- (_vm.height - 6) +
- " 6, " +
- (_vm.height - 6) +
- " 6, 6"
- }
- }),
- _vm._v(" "),
- _c("circle", {
- attrs: { fill: _vm.mergedColor[0], cx: "11", cy: "11", r: "1" }
- }),
- _vm._v(" "),
- _c("circle", {
- attrs: {
- fill: _vm.mergedColor[0],
- cx: _vm.width - 11,
- cy: "11",
- r: "1"
- }
- }),
- _vm._v(" "),
- _c("circle", {
- attrs: {
- fill: _vm.mergedColor[0],
- cx: _vm.width - 11,
- cy: _vm.height - 11,
- r: "1"
- }
- }),
- _vm._v(" "),
- _c("circle", {
- attrs: {
- fill: _vm.mergedColor[0],
- cx: "11",
- cy: _vm.height - 11,
- r: "1"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
- ])
- };
- var __vue_staticRenderFns__$3 = [];
- __vue_render__$3._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$3 = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$3 = undefined;
- /* module identifier */
- const __vue_module_identifier__$3 = undefined;
- /* functional template */
- const __vue_is_functional_template__$3 = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$3 = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },
- __vue_inject_styles__$3,
- __vue_script__$3,
- __vue_scope_id__$3,
- __vue_is_functional_template__$3,
- __vue_module_identifier__$3,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function borderBox2 (Vue) {
- Vue.component(__vue_component__$3.name, __vue_component__$3);
- }
-
- //
- var script$4 = {
- name: 'DvBorderBox3',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- backgroundColor: {
- type: String,
- default: 'transparent'
- }
- },
-
- data() {
- return {
- ref: 'border-box-3',
- defaultColor: ['#2862b7', '#2862b7'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$4 = script$4;
-
- /* template */
- var __vue_render__$4 = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-3" }, [
- _c(
- "svg",
- {
- staticClass: "dv-border-svg-container",
- attrs: { width: _vm.width, height: _vm.height }
- },
- [
- _c("polygon", {
- attrs: {
- fill: _vm.backgroundColor,
- points:
- "\n 23, 23 " +
- (_vm.width - 24) +
- ", 23 " +
- (_vm.width - 24) +
- ", " +
- (_vm.height - 24) +
- " 23, " +
- (_vm.height - 24) +
- "\n "
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb3-line1",
- attrs: {
- stroke: _vm.mergedColor[0],
- points:
- "4, 4 " +
- (_vm.width - 22) +
- " ,4 " +
- (_vm.width - 22) +
- ", " +
- (_vm.height - 22) +
- " 4, " +
- (_vm.height - 22) +
- " 4, 4"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb3-line2",
- attrs: {
- stroke: _vm.mergedColor[1],
- points:
- "10, 10 " +
- (_vm.width - 16) +
- ", 10 " +
- (_vm.width - 16) +
- ", " +
- (_vm.height - 16) +
- " 10, " +
- (_vm.height - 16) +
- " 10, 10"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb3-line2",
- attrs: {
- stroke: _vm.mergedColor[1],
- points:
- "16, 16 " +
- (_vm.width - 10) +
- ", 16 " +
- (_vm.width - 10) +
- ", " +
- (_vm.height - 10) +
- " 16, " +
- (_vm.height - 10) +
- " 16, 16"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb3-line2",
- attrs: {
- stroke: _vm.mergedColor[1],
- points:
- "22, 22 " +
- (_vm.width - 4) +
- ", 22 " +
- (_vm.width - 4) +
- ", " +
- (_vm.height - 4) +
- " 22, " +
- (_vm.height - 4) +
- " 22, 22"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
- ])
- };
- var __vue_staticRenderFns__$4 = [];
- __vue_render__$4._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$4 = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$4 = undefined;
- /* module identifier */
- const __vue_module_identifier__$4 = undefined;
- /* functional template */
- const __vue_is_functional_template__$4 = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$4 = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 },
- __vue_inject_styles__$4,
- __vue_script__$4,
- __vue_scope_id__$4,
- __vue_is_functional_template__$4,
- __vue_module_identifier__$4,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function borderBox3 (Vue) {
- Vue.component(__vue_component__$4.name, __vue_component__$4);
- }
-
- //
- var script$5 = {
- name: 'DvBorderBox4',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- reverse: {
- type: Boolean,
- default: false
- },
- backgroundColor: {
- type: String,
- default: 'transparent'
- }
- },
-
- data() {
- return {
- ref: 'border-box-4',
- defaultColor: ['red', 'rgba(0,0,255,0.8)'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$5 = script$5;
-
- /* template */
- var __vue_render__$5 = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-4" }, [
- _c(
- "svg",
- {
- class: "dv-border-svg-container " + (_vm.reverse && "dv-reverse"),
- attrs: { width: _vm.width, height: _vm.height }
- },
- [
- _c("polygon", {
- attrs: {
- fill: _vm.backgroundColor,
- points:
- "\n " +
- (_vm.width - 15) +
- ", 22 170, 22 150, 7 40, 7 28, 21 32, 24\n 16, 42 16, " +
- (_vm.height - 32) +
- " 41, " +
- (_vm.height - 7) +
- " " +
- (_vm.width - 15) +
- ", " +
- (_vm.height - 7) +
- "\n "
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb4-line-1",
- attrs: {
- stroke: _vm.mergedColor[0],
- points:
- "145, " +
- (_vm.height - 5) +
- " 40, " +
- (_vm.height - 5) +
- " 10, " +
- (_vm.height - 35) +
- "\n 10, 40 40, 5 150, 5 170, 20 " +
- (_vm.width - 15) +
- ", 20"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb4-line-2",
- attrs: {
- stroke: _vm.mergedColor[1],
- points:
- "245, " +
- (_vm.height - 1) +
- " 36, " +
- (_vm.height - 1) +
- " 14, " +
- (_vm.height - 23) +
- "\n 14, " +
- (_vm.height - 100)
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb4-line-3",
- attrs: {
- stroke: _vm.mergedColor[0],
- points: "7, " + (_vm.height - 40) + " 7, " + (_vm.height - 75)
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb4-line-4",
- attrs: { stroke: _vm.mergedColor[0], points: "28, 24 13, 41 13, 64" }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb4-line-5",
- attrs: { stroke: _vm.mergedColor[0], points: "5, 45 5, 140" }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb4-line-6",
- attrs: { stroke: _vm.mergedColor[1], points: "14, 75 14, 180" }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb4-line-7",
- attrs: {
- stroke: _vm.mergedColor[1],
- points: "55, 11 147, 11 167, 26 250, 26"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb4-line-8",
- attrs: { stroke: _vm.mergedColor[1], points: "158, 5 173, 16" }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb4-line-9",
- attrs: {
- stroke: _vm.mergedColor[0],
- points: "200, 17 " + (_vm.width - 10) + ", 17"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb4-line-10",
- attrs: {
- stroke: _vm.mergedColor[1],
- points: "385, 17 " + (_vm.width - 10) + ", 17"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
- ])
- };
- var __vue_staticRenderFns__$5 = [];
- __vue_render__$5._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$5 = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$5 = undefined;
- /* module identifier */
- const __vue_module_identifier__$5 = undefined;
- /* functional template */
- const __vue_is_functional_template__$5 = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$5 = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 },
- __vue_inject_styles__$5,
- __vue_script__$5,
- __vue_scope_id__$5,
- __vue_is_functional_template__$5,
- __vue_module_identifier__$5,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function borderBox4 (Vue) {
- Vue.component(__vue_component__$5.name, __vue_component__$5);
- }
-
- //
- var script$6 = {
- name: 'DvBorderBox5',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- reverse: {
- type: Boolean,
- default: false
- },
- backgroundColor: {
- type: String,
- default: 'transparent'
- }
- },
-
- data() {
- return {
- ref: 'border-box-5',
- defaultColor: ['rgba(255, 255, 255, 0.35)', 'rgba(255, 255, 255, 0.20)'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$6 = script$6;
-
- /* template */
- var __vue_render__$6 = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-5" }, [
- _c(
- "svg",
- {
- class: "dv-border-svg-container " + (_vm.reverse && "dv-reverse"),
- attrs: { width: _vm.width, height: _vm.height }
- },
- [
- _c("polygon", {
- attrs: {
- fill: _vm.backgroundColor,
- points:
- "\n 10, 22 " +
- (_vm.width - 22) +
- ", 22 " +
- (_vm.width - 22) +
- ", " +
- (_vm.height - 86) +
- " " +
- (_vm.width - 84) +
- ", " +
- (_vm.height - 24) +
- " 10, " +
- (_vm.height - 24) +
- "\n "
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb5-line-1",
- attrs: {
- stroke: _vm.mergedColor[0],
- points:
- "8, 5 " +
- (_vm.width - 5) +
- ", 5 " +
- (_vm.width - 5) +
- ", " +
- (_vm.height - 100) +
- "\n " +
- (_vm.width - 100) +
- ", " +
- (_vm.height - 5) +
- " 8, " +
- (_vm.height - 5) +
- " 8, 5"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb5-line-2",
- attrs: {
- stroke: _vm.mergedColor[1],
- points:
- "3, 5 " +
- (_vm.width - 20) +
- ", 5 " +
- (_vm.width - 20) +
- ", " +
- (_vm.height - 60) +
- "\n " +
- (_vm.width - 74) +
- ", " +
- (_vm.height - 5) +
- " 3, " +
- (_vm.height - 5) +
- " 3, 5"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb5-line-3",
- attrs: {
- stroke: _vm.mergedColor[1],
- points: "50, 13 " + (_vm.width - 35) + ", 13"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb5-line-4",
- attrs: {
- stroke: _vm.mergedColor[1],
- points: "15, 20 " + (_vm.width - 35) + ", 20"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb5-line-5",
- attrs: {
- stroke: _vm.mergedColor[1],
- points:
- "15, " +
- (_vm.height - 20) +
- " " +
- (_vm.width - 110) +
- ", " +
- (_vm.height - 20)
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb5-line-6",
- attrs: {
- stroke: _vm.mergedColor[1],
- points:
- "15, " +
- (_vm.height - 13) +
- " " +
- (_vm.width - 110) +
- ", " +
- (_vm.height - 13)
- }
- })
- ]
- ),
- _vm._v(" "),
- _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
- ])
- };
- var __vue_staticRenderFns__$6 = [];
- __vue_render__$6._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$6 = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$6 = undefined;
- /* module identifier */
- const __vue_module_identifier__$6 = undefined;
- /* functional template */
- const __vue_is_functional_template__$6 = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$6 = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 },
- __vue_inject_styles__$6,
- __vue_script__$6,
- __vue_scope_id__$6,
- __vue_is_functional_template__$6,
- __vue_module_identifier__$6,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function borderBox5 (Vue) {
- Vue.component(__vue_component__$6.name, __vue_component__$6);
- }
-
- //
- var script$7 = {
- name: 'DvBorderBox6',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- backgroundColor: {
- type: String,
- default: 'transparent'
- }
- },
-
- data() {
- return {
- ref: 'border-box-6',
- defaultColor: ['rgba(255, 255, 255, 0.35)', 'gray'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$7 = script$7;
-
- /* template */
- var __vue_render__$7 = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-6" }, [
- _c(
- "svg",
- {
- staticClass: "dv-border-svg-container",
- attrs: { width: _vm.width, height: _vm.height }
- },
- [
- _c("polygon", {
- attrs: {
- fill: _vm.backgroundColor,
- points:
- "\n 9, 7 " +
- (_vm.width - 9) +
- ", 7 " +
- (_vm.width - 9) +
- ", " +
- (_vm.height - 7) +
- " 9, " +
- (_vm.height - 7) +
- "\n "
- }
- }),
- _vm._v(" "),
- _c("circle", {
- attrs: { fill: _vm.mergedColor[1], cx: "5", cy: "5", r: "2" }
- }),
- _vm._v(" "),
- _c("circle", {
- attrs: {
- fill: _vm.mergedColor[1],
- cx: _vm.width - 5,
- cy: "5",
- r: "2"
- }
- }),
- _vm._v(" "),
- _c("circle", {
- attrs: {
- fill: _vm.mergedColor[1],
- cx: _vm.width - 5,
- cy: _vm.height - 5,
- r: "2"
- }
- }),
- _vm._v(" "),
- _c("circle", {
- attrs: {
- fill: _vm.mergedColor[1],
- cx: "5",
- cy: _vm.height - 5,
- r: "2"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[0],
- points: "10, 4 " + (_vm.width - 10) + ", 4"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[0],
- points:
- "10, " +
- (_vm.height - 4) +
- " " +
- (_vm.width - 10) +
- ", " +
- (_vm.height - 4)
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[0],
- points: "5, 70 5, " + (_vm.height - 70)
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[0],
- points:
- _vm.width -
- 5 +
- ", 70 " +
- (_vm.width - 5) +
- ", " +
- (_vm.height - 70)
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: { stroke: _vm.mergedColor[0], points: "3, 10, 3, 50" }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: { stroke: _vm.mergedColor[0], points: "7, 30 7, 80" }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[0],
- points: _vm.width - 3 + ", 10 " + (_vm.width - 3) + ", 50"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[0],
- points: _vm.width - 7 + ", 30 " + (_vm.width - 7) + ", 80"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[0],
- points: "3, " + (_vm.height - 10) + " 3, " + (_vm.height - 50)
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[0],
- points: "7, " + (_vm.height - 30) + " 7, " + (_vm.height - 80)
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[0],
- points:
- _vm.width -
- 3 +
- ", " +
- (_vm.height - 10) +
- " " +
- (_vm.width - 3) +
- ", " +
- (_vm.height - 50)
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[0],
- points:
- _vm.width -
- 7 +
- ", " +
- (_vm.height - 30) +
- " " +
- (_vm.width - 7) +
- ", " +
- (_vm.height - 80)
- }
- })
- ]
- ),
- _vm._v(" "),
- _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
- ])
- };
- var __vue_staticRenderFns__$7 = [];
- __vue_render__$7._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$7 = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$7 = undefined;
- /* module identifier */
- const __vue_module_identifier__$7 = undefined;
- /* functional template */
- const __vue_is_functional_template__$7 = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$7 = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 },
- __vue_inject_styles__$7,
- __vue_script__$7,
- __vue_scope_id__$7,
- __vue_is_functional_template__$7,
- __vue_module_identifier__$7,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function borderBox6 (Vue) {
- Vue.component(__vue_component__$7.name, __vue_component__$7);
- }
-
- //
- var script$8 = {
- name: 'DvBorderBox7',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- backgroundColor: {
- type: String,
- default: 'transparent'
- }
- },
-
- data() {
- return {
- ref: 'border-box-7',
- defaultColor: ['rgba(128,128,128,0.3)', 'rgba(128,128,128,0.5)'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$8 = script$8;
-
- /* template */
- var __vue_render__$8 = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c(
- "div",
- {
- ref: _vm.ref,
- staticClass: "dv-border-box-7",
- style:
- "box-shadow: inset 0 0 40px " +
- _vm.mergedColor[0] +
- "; border: 1px solid " +
- _vm.mergedColor[0] +
- "; background-color: " +
- _vm.backgroundColor
- },
- [
- _c(
- "svg",
- {
- staticClass: "dv-border-svg-container",
- attrs: { width: _vm.width, height: _vm.height }
- },
- [
- _c("polyline", {
- staticClass: "dv-bb7-line-width-2",
- attrs: { stroke: _vm.mergedColor[0], points: "0, 25 0, 0 25, 0" }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb7-line-width-2",
- attrs: {
- stroke: _vm.mergedColor[0],
- points:
- _vm.width -
- 25 +
- ", 0 " +
- _vm.width +
- ", 0 " +
- _vm.width +
- ", 25"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb7-line-width-2",
- attrs: {
- stroke: _vm.mergedColor[0],
- points:
- _vm.width -
- 25 +
- ", " +
- _vm.height +
- " " +
- _vm.width +
- ", " +
- _vm.height +
- " " +
- _vm.width +
- ", " +
- (_vm.height - 25)
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb7-line-width-2",
- attrs: {
- stroke: _vm.mergedColor[0],
- points:
- "0, " +
- (_vm.height - 25) +
- " 0, " +
- _vm.height +
- " 25, " +
- _vm.height
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb7-line-width-5",
- attrs: { stroke: _vm.mergedColor[1], points: "0, 10 0, 0 10, 0" }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb7-line-width-5",
- attrs: {
- stroke: _vm.mergedColor[1],
- points:
- _vm.width -
- 10 +
- ", 0 " +
- _vm.width +
- ", 0 " +
- _vm.width +
- ", 10"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb7-line-width-5",
- attrs: {
- stroke: _vm.mergedColor[1],
- points:
- _vm.width -
- 10 +
- ", " +
- _vm.height +
- " " +
- _vm.width +
- ", " +
- _vm.height +
- " " +
- _vm.width +
- ", " +
- (_vm.height - 10)
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "dv-bb7-line-width-5",
- attrs: {
- stroke: _vm.mergedColor[1],
- points:
- "0, " +
- (_vm.height - 10) +
- " 0, " +
- _vm.height +
- " 10, " +
- _vm.height
- }
- })
- ]
- ),
- _vm._v(" "),
- _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
- ]
- )
- };
- var __vue_staticRenderFns__$8 = [];
- __vue_render__$8._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$8 = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$8 = undefined;
- /* module identifier */
- const __vue_module_identifier__$8 = undefined;
- /* functional template */
- const __vue_is_functional_template__$8 = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$8 = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 },
- __vue_inject_styles__$8,
- __vue_script__$8,
- __vue_scope_id__$8,
- __vue_is_functional_template__$8,
- __vue_module_identifier__$8,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function borderBox7 (Vue) {
- Vue.component(__vue_component__$8.name, __vue_component__$8);
- }
-
- //
- var script$9 = {
- name: 'DvBorderBox8',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- dur: {
- type: Number,
- default: 3
- },
- backgroundColor: {
- type: String,
- default: 'transparent'
- },
- reverse: {
- type: Boolean,
- default: false
- }
- },
-
- data() {
- const id = uuid();
- return {
- ref: 'border-box-8',
- path: `border-box-8-path-${id}`,
- gradient: `border-box-8-gradient-${id}`,
- mask: `border-box-8-mask-${id}`,
- defaultColor: ['#235fa7', '#4fd2dd'],
- mergedColor: []
- };
- },
-
- computed: {
- length() {
- const {
- width,
- height
- } = this;
- return (width + height - 5) * 2;
- },
-
- pathD() {
- const {
- reverse,
- width,
- height
- } = this;
- 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`;
- 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`;
- }
-
- },
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$9 = script$9;
-
- /* template */
- var __vue_render__$9 = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-8" }, [
- _c(
- "svg",
- {
- staticClass: "dv-border-svg-container",
- attrs: { width: _vm.width, height: _vm.height }
- },
- [
- _c(
- "defs",
- [
- _c("path", {
- attrs: { id: _vm.path, d: _vm.pathD, fill: "transparent" }
- }),
- _vm._v(" "),
- _c(
- "radialGradient",
- { attrs: { id: _vm.gradient, cx: "50%", cy: "50%", r: "50%" } },
- [
- _c("stop", {
- attrs: {
- offset: "0%",
- "stop-color": "#fff",
- "stop-opacity": "1"
- }
- }),
- _vm._v(" "),
- _c("stop", {
- attrs: {
- offset: "100%",
- "stop-color": "#fff",
- "stop-opacity": "0"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c("mask", { attrs: { id: _vm.mask } }, [
- _c(
- "circle",
- {
- attrs: {
- cx: "0",
- cy: "0",
- r: "150",
- fill: "url(#" + _vm.gradient + ")"
- }
- },
- [
- _c("animateMotion", {
- attrs: {
- dur: _vm.dur + "s",
- path: _vm.pathD,
- rotate: "auto",
- repeatCount: "indefinite"
- }
- })
- ],
- 1
- )
- ])
- ],
- 1
- ),
- _vm._v(" "),
- _c("polygon", {
- attrs: {
- fill: _vm.backgroundColor,
- points:
- "5, 5 " +
- (_vm.width - 5) +
- ", 5 " +
- (_vm.width - 5) +
- " " +
- (_vm.height - 5) +
- " 5, " +
- (_vm.height - 5)
- }
- }),
- _vm._v(" "),
- _c("use", {
- attrs: {
- stroke: _vm.mergedColor[0],
- "stroke-width": "1",
- "xlink:href": "#" + _vm.path
- }
- }),
- _vm._v(" "),
- _c(
- "use",
- {
- attrs: {
- stroke: _vm.mergedColor[1],
- "stroke-width": "3",
- "xlink:href": "#" + _vm.path,
- mask: "url(#" + _vm.mask + ")"
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "stroke-dasharray",
- from: "0, " + _vm.length,
- to: _vm.length + ", 0",
- dur: _vm.dur + "s",
- repeatCount: "indefinite"
- }
- })
- ]
- )
- ]
- ),
- _vm._v(" "),
- _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
- ])
- };
- var __vue_staticRenderFns__$9 = [];
- __vue_render__$9._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$9 = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$9 = undefined;
- /* module identifier */
- const __vue_module_identifier__$9 = undefined;
- /* functional template */
- const __vue_is_functional_template__$9 = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$9 = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$9, staticRenderFns: __vue_staticRenderFns__$9 },
- __vue_inject_styles__$9,
- __vue_script__$9,
- __vue_scope_id__$9,
- __vue_is_functional_template__$9,
- __vue_module_identifier__$9,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function borderBox8 (Vue) {
- Vue.component(__vue_component__$9.name, __vue_component__$9);
- }
-
- //
- var script$a = {
- name: 'DvBorderBox9',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- backgroundColor: {
- type: String,
- default: 'transparent'
- }
- },
-
- data() {
- const id = uuid();
- return {
- ref: 'border-box-9',
- gradientId: `border-box-9-gradient-${id}`,
- maskId: `border-box-9-mask-${id}`,
- defaultColor: ['#11eefd', '#0078d2'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$a = script$a;
-
- /* template */
- var __vue_render__$a = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-9" }, [
- _c(
- "svg",
- {
- staticClass: "dv-border-svg-container",
- attrs: { width: _vm.width, height: _vm.height }
- },
- [
- _c(
- "defs",
- [
- _c(
- "linearGradient",
- {
- attrs: {
- id: _vm.gradientId,
- x1: "0%",
- y1: "0%",
- x2: "100%",
- y2: "100%"
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "x1",
- values: "0%;100%;0%",
- dur: "10s",
- begin: "0s",
- repeatCount: "indefinite"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "x2",
- values: "100%;0%;100%",
- dur: "10s",
- begin: "0s",
- repeatCount: "indefinite"
- }
- }),
- _vm._v(" "),
- _c(
- "stop",
- { attrs: { offset: "0%", "stop-color": _vm.mergedColor[0] } },
- [
- _c("animate", {
- attrs: {
- attributeName: "stop-color",
- values:
- _vm.mergedColor[0] +
- ";" +
- _vm.mergedColor[1] +
- ";" +
- _vm.mergedColor[0],
- dur: "10s",
- begin: "0s",
- repeatCount: "indefinite"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "stop",
- {
- attrs: { offset: "100%", "stop-color": _vm.mergedColor[1] }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "stop-color",
- values:
- _vm.mergedColor[1] +
- ";" +
- _vm.mergedColor[0] +
- ";" +
- _vm.mergedColor[1],
- dur: "10s",
- begin: "0s",
- repeatCount: "indefinite"
- }
- })
- ]
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c("mask", { attrs: { id: _vm.maskId } }, [
- _c("polyline", {
- attrs: {
- stroke: "#fff",
- "stroke-width": "3",
- fill: "transparent",
- points:
- "8, " +
- _vm.height * 0.4 +
- " 8, 3, " +
- (_vm.width * 0.4 + 7) +
- ", 3"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- fill: "#fff",
- points:
- "8, " +
- _vm.height * 0.15 +
- " 8, 3, " +
- (_vm.width * 0.1 + 7) +
- ", 3\n " +
- _vm.width * 0.1 +
- ", 8 14, 8 14, " +
- (_vm.height * 0.15 - 7) +
- "\n "
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: "#fff",
- "stroke-width": "3",
- fill: "transparent",
- points:
- _vm.width * 0.5 +
- ", 3 " +
- (_vm.width - 3) +
- ", 3, " +
- (_vm.width - 3) +
- ", " +
- _vm.height * 0.25
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- fill: "#fff",
- points:
- "\n " +
- _vm.width * 0.52 +
- ", 3 " +
- _vm.width * 0.58 +
- ", 3\n " +
- (_vm.width * 0.58 - 7) +
- ", 9 " +
- (_vm.width * 0.52 + 7) +
- ", 9\n "
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- fill: "#fff",
- points:
- "\n " +
- _vm.width * 0.9 +
- ", 3 " +
- (_vm.width - 3) +
- ", 3 " +
- (_vm.width - 3) +
- ", " +
- _vm.height * 0.1 +
- "\n " +
- (_vm.width - 9) +
- ", " +
- (_vm.height * 0.1 - 7) +
- " " +
- (_vm.width - 9) +
- ", 9 " +
- (_vm.width * 0.9 + 7) +
- ", 9\n "
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: "#fff",
- "stroke-width": "3",
- fill: "transparent",
- points:
- "8, " +
- _vm.height * 0.5 +
- " 8, " +
- (_vm.height - 3) +
- " " +
- (_vm.width * 0.3 + 7) +
- ", " +
- (_vm.height - 3)
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- fill: "#fff",
- points:
- "\n 8, " +
- _vm.height * 0.55 +
- " 8, " +
- _vm.height * 0.7 +
- "\n 2, " +
- (_vm.height * 0.7 - 7) +
- " 2, " +
- (_vm.height * 0.55 + 7) +
- "\n "
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: "#fff",
- "stroke-width": "3",
- fill: "transparent",
- points:
- _vm.width * 0.35 +
- ", " +
- (_vm.height - 3) +
- " " +
- (_vm.width - 3) +
- ", " +
- (_vm.height - 3) +
- " " +
- (_vm.width - 3) +
- ", " +
- _vm.height * 0.35
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- fill: "#fff",
- points:
- "\n " +
- _vm.width * 0.92 +
- ", " +
- (_vm.height - 3) +
- " " +
- (_vm.width - 3) +
- ", " +
- (_vm.height - 3) +
- " " +
- (_vm.width - 3) +
- ", " +
- _vm.height * 0.8 +
- "\n " +
- (_vm.width - 9) +
- ", " +
- (_vm.height * 0.8 + 7) +
- " " +
- (_vm.width - 9) +
- ", " +
- (_vm.height - 9) +
- " " +
- (_vm.width * 0.92 + 7) +
- ", " +
- (_vm.height - 9) +
- "\n "
- }
- })
- ])
- ],
- 1
- ),
- _vm._v(" "),
- _c("polygon", {
- attrs: {
- fill: _vm.backgroundColor,
- points:
- "\n 15, 9 " +
- (_vm.width * 0.1 + 1) +
- ", 9 " +
- (_vm.width * 0.1 + 4) +
- ", 6 " +
- (_vm.width * 0.52 + 2) +
- ", 6\n " +
- (_vm.width * 0.52 + 6) +
- ", 10 " +
- (_vm.width * 0.58 - 7) +
- ", 10 " +
- (_vm.width * 0.58 - 2) +
- ", 6\n " +
- (_vm.width * 0.9 + 2) +
- ", 6 " +
- (_vm.width * 0.9 + 6) +
- ", 10 " +
- (_vm.width - 10) +
- ", 10 " +
- (_vm.width - 10) +
- ", " +
- (_vm.height * 0.1 - 6) +
- "\n " +
- (_vm.width - 6) +
- ", " +
- (_vm.height * 0.1 - 1) +
- " " +
- (_vm.width - 6) +
- ", " +
- (_vm.height * 0.8 + 1) +
- " " +
- (_vm.width - 10) +
- ", " +
- (_vm.height * 0.8 + 6) +
- "\n " +
- (_vm.width - 10) +
- ", " +
- (_vm.height - 10) +
- " " +
- (_vm.width * 0.92 + 7) +
- ", " +
- (_vm.height - 10) +
- " " +
- (_vm.width * 0.92 + 2) +
- ", " +
- (_vm.height - 6) +
- "\n 11, " +
- (_vm.height - 6) +
- " 11, " +
- (_vm.height * 0.15 - 2) +
- " 15, " +
- (_vm.height * 0.15 - 7) +
- "\n "
- }
- }),
- _vm._v(" "),
- _c("rect", {
- attrs: {
- x: "0",
- y: "0",
- width: _vm.width,
- height: _vm.height,
- fill: "url(#" + _vm.gradientId + ")",
- mask: "url(#" + _vm.maskId + ")"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
- ])
- };
- var __vue_staticRenderFns__$a = [];
- __vue_render__$a._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$a = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$a = undefined;
- /* module identifier */
- const __vue_module_identifier__$a = undefined;
- /* functional template */
- const __vue_is_functional_template__$a = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$a = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$a, staticRenderFns: __vue_staticRenderFns__$a },
- __vue_inject_styles__$a,
- __vue_script__$a,
- __vue_scope_id__$a,
- __vue_is_functional_template__$a,
- __vue_module_identifier__$a,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function borderBox9 (Vue) {
- Vue.component(__vue_component__$a.name, __vue_component__$a);
- }
-
- //
- var script$b = {
- name: 'DvBorderBox10',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- backgroundColor: {
- type: String,
- default: 'transparent'
- }
- },
-
- data() {
- return {
- ref: 'border-box-10',
- border: ['left-top', 'right-top', 'left-bottom', 'right-bottom'],
- defaultColor: ['#1d48c4', '#d3e1f8'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$b = script$b;
-
- /* template */
- var __vue_render__$b = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c(
- "div",
- {
- ref: _vm.ref,
- staticClass: "dv-border-box-10",
- style: "box-shadow: inset 0 0 25px 3px " + _vm.mergedColor[0]
- },
- [
- _c(
- "svg",
- {
- staticClass: "dv-border-svg-container",
- attrs: { width: _vm.width, height: _vm.height }
- },
- [
- _c("polygon", {
- attrs: {
- fill: _vm.backgroundColor,
- points:
- "\n 4, 0 " +
- (_vm.width - 4) +
- ", 0 " +
- _vm.width +
- ", 4 " +
- _vm.width +
- ", " +
- (_vm.height - 4) +
- " " +
- (_vm.width - 4) +
- ", " +
- _vm.height +
- "\n 4, " +
- _vm.height +
- " 0, " +
- (_vm.height - 4) +
- " 0, 4\n "
- }
- })
- ]
- ),
- _vm._v(" "),
- _vm._l(_vm.border, function(item) {
- return _c(
- "svg",
- {
- key: item,
- class: item + " dv-border-svg-container",
- attrs: { width: "150px", height: "150px" }
- },
- [
- _c("polygon", {
- attrs: {
- fill: _vm.mergedColor[1],
- points: "40, 0 5, 0 0, 5 0, 16 3, 19 3, 7 7, 3 35, 3"
- }
- })
- ]
- )
- }),
- _vm._v(" "),
- _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
- ],
- 2
- )
- };
- var __vue_staticRenderFns__$b = [];
- __vue_render__$b._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$b = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$b = undefined;
- /* module identifier */
- const __vue_module_identifier__$b = undefined;
- /* functional template */
- const __vue_is_functional_template__$b = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$b = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$b, staticRenderFns: __vue_staticRenderFns__$b },
- __vue_inject_styles__$b,
- __vue_script__$b,
- __vue_scope_id__$b,
- __vue_is_functional_template__$b,
- __vue_module_identifier__$b,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function borderBox10 (Vue) {
- Vue.component(__vue_component__$b.name, __vue_component__$b);
- }
-
- var keywords = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
-
- 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']]);
-
- exports["default"] = _default;
- });
-
- unwrapExports(keywords);
-
- var lib = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.getRgbValue = getRgbValue;
- exports.getRgbaValue = getRgbaValue;
- exports.getOpacity = getOpacity;
- exports.toRgb = toRgb;
- exports.toHex = toHex;
- exports.getColorFromRgbValue = getColorFromRgbValue;
- exports.darken = darken;
- exports.lighten = lighten;
- exports.fade = fade;
- exports["default"] = void 0;
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
- var _keywords = interopRequireDefault(keywords);
-
- var hexReg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
- var rgbReg = /^(rgb|rgba|RGB|RGBA)/;
- var rgbaReg = /^(rgba|RGBA)/;
- /**
- * @description Color validator
- * @param {String} color Hex|Rgb|Rgba color or color keyword
- * @return {String|Boolean} Valid color Or false
- */
-
- function validator(color) {
- var isHex = hexReg.test(color);
- var isRgb = rgbReg.test(color);
- if (isHex || isRgb) return color;
- color = getColorByKeyword(color);
-
- if (!color) {
- console.error('Color: Invalid color!');
- return false;
- }
-
- return color;
- }
- /**
- * @description Get color by keyword
- * @param {String} keyword Color keyword like red, green and etc.
- * @return {String|Boolean} Hex or rgba color (Invalid keyword will return false)
- */
-
-
- function getColorByKeyword(keyword) {
- if (!keyword) {
- console.error('getColorByKeywords: Missing parameters!');
- return false;
- }
-
- if (!_keywords["default"].has(keyword)) return false;
- return _keywords["default"].get(keyword);
- }
- /**
- * @description Get the Rgb value of the color
- * @param {String} color Hex|Rgb|Rgba color or color keyword
- * @return {Array<Number>|Boolean} Rgb value of the color (Invalid input will return false)
- */
-
-
- function getRgbValue(color) {
- if (!color) {
- console.error('getRgbValue: Missing parameters!');
- return false;
- }
-
- color = validator(color);
- if (!color) return false;
- var isHex = hexReg.test(color);
- var isRgb = rgbReg.test(color);
- var lowerColor = color.toLowerCase();
- if (isHex) return getRgbValueFromHex(lowerColor);
- if (isRgb) return getRgbValueFromRgb(lowerColor);
- }
- /**
- * @description Get the rgb value of the hex color
- * @param {String} color Hex color
- * @return {Array<Number>} Rgb value of the color
- */
-
-
- function getRgbValueFromHex(color) {
- color = color.replace('#', '');
- if (color.length === 3) color = Array.from(color).map(function (hexNum) {
- return hexNum + hexNum;
- }).join('');
- color = color.split('');
- return new Array(3).fill(0).map(function (t, i) {
- return parseInt("0x".concat(color[i * 2]).concat(color[i * 2 + 1]));
- });
- }
- /**
- * @description Get the rgb value of the rgb/rgba color
- * @param {String} color Hex color
- * @return {Array} Rgb value of the color
- */
-
-
- function getRgbValueFromRgb(color) {
- return color.replace(/rgb\(|rgba\(|\)/g, '').split(',').slice(0, 3).map(function (n) {
- return parseInt(n);
- });
- }
- /**
- * @description Get the Rgba value of the color
- * @param {String} color Hex|Rgb|Rgba color or color keyword
- * @return {Array<Number>|Boolean} Rgba value of the color (Invalid input will return false)
- */
-
-
- function getRgbaValue(color) {
- if (!color) {
- console.error('getRgbaValue: Missing parameters!');
- return false;
- }
-
- var colorValue = getRgbValue(color);
- if (!colorValue) return false;
- colorValue.push(getOpacity(color));
- return colorValue;
- }
- /**
- * @description Get the opacity of color
- * @param {String} color Hex|Rgb|Rgba color or color keyword
- * @return {Number|Boolean} Color opacity (Invalid input will return false)
- */
-
-
- function getOpacity(color) {
- if (!color) {
- console.error('getOpacity: Missing parameters!');
- return false;
- }
-
- color = validator(color);
- if (!color) return false;
- var isRgba = rgbaReg.test(color);
- if (!isRgba) return 1;
- color = color.toLowerCase();
- return Number(color.split(',').slice(-1)[0].replace(/[)|\s]/g, ''));
- }
- /**
- * @description Convert color to Rgb|Rgba color
- * @param {String} color Hex|Rgb|Rgba color or color keyword
- * @param {Number} opacity The opacity of color
- * @return {String|Boolean} Rgb|Rgba color (Invalid input will return false)
- */
-
-
- function toRgb(color, opacity) {
- if (!color) {
- console.error('toRgb: Missing parameters!');
- return false;
- }
-
- var rgbValue = getRgbValue(color);
- if (!rgbValue) return false;
- var addOpacity = typeof opacity === 'number';
- if (addOpacity) return 'rgba(' + rgbValue.join(',') + ",".concat(opacity, ")");
- return 'rgb(' + rgbValue.join(',') + ')';
- }
- /**
- * @description Convert color to Hex color
- * @param {String} color Hex|Rgb|Rgba color or color keyword
- * @return {String|Boolean} Hex color (Invalid input will return false)
- */
-
-
- function toHex(color) {
- if (!color) {
- console.error('toHex: Missing parameters!');
- return false;
- }
-
- if (hexReg.test(color)) return color;
- color = getRgbValue(color);
- if (!color) return false;
- return '#' + color.map(function (n) {
- return Number(n).toString(16);
- }).map(function (n) {
- return n === '0' ? '00' : n;
- }).join('');
- }
- /**
- * @description Get Color from Rgb|Rgba value
- * @param {Array<Number>} value Rgb|Rgba color value
- * @return {String|Boolean} Rgb|Rgba color (Invalid input will return false)
- */
-
-
- function getColorFromRgbValue(value) {
- if (!value) {
- console.error('getColorFromRgbValue: Missing parameters!');
- return false;
- }
-
- var valueLength = value.length;
-
- if (valueLength !== 3 && valueLength !== 4) {
- console.error('getColorFromRgbValue: Value is illegal!');
- return false;
- }
-
- var color = valueLength === 3 ? 'rgb(' : 'rgba(';
- color += value.join(',') + ')';
- return color;
- }
- /**
- * @description Deepen color
- * @param {String} color Hex|Rgb|Rgba color or color keyword
- * @return {Number} Percent of Deepen (1-100)
- * @return {String|Boolean} Rgba color (Invalid input will return false)
- */
-
-
- function darken(color) {
- var percent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
-
- if (!color) {
- console.error('darken: Missing parameters!');
- return false;
- }
-
- var rgbaValue = getRgbaValue(color);
- if (!rgbaValue) return false;
- rgbaValue = rgbaValue.map(function (v, i) {
- return i === 3 ? v : v - Math.ceil(2.55 * percent);
- }).map(function (v) {
- return v < 0 ? 0 : v;
- });
- return getColorFromRgbValue(rgbaValue);
- }
- /**
- * @description Brighten color
- * @param {String} color Hex|Rgb|Rgba color or color keyword
- * @return {Number} Percent of brighten (1-100)
- * @return {String|Boolean} Rgba color (Invalid input will return false)
- */
-
-
- function lighten(color) {
- var percent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
-
- if (!color) {
- console.error('lighten: Missing parameters!');
- return false;
- }
-
- var rgbaValue = getRgbaValue(color);
- if (!rgbaValue) return false;
- rgbaValue = rgbaValue.map(function (v, i) {
- return i === 3 ? v : v + Math.ceil(2.55 * percent);
- }).map(function (v) {
- return v > 255 ? 255 : v;
- });
- return getColorFromRgbValue(rgbaValue);
- }
- /**
- * @description Adjust color opacity
- * @param {String} color Hex|Rgb|Rgba color or color keyword
- * @param {Number} Percent of opacity
- * @return {String|Boolean} Rgba color (Invalid input will return false)
- */
-
-
- function fade(color) {
- var percent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
-
- if (!color) {
- console.error('fade: Missing parameters!');
- return false;
- }
-
- var rgbValue = getRgbValue(color);
- if (!rgbValue) return false;
- var rgbaValue = [].concat((0, _toConsumableArray2["default"])(rgbValue), [percent / 100]);
- return getColorFromRgbValue(rgbaValue);
- }
-
- var _default = {
- fade: fade,
- toHex: toHex,
- toRgb: toRgb,
- darken: darken,
- lighten: lighten,
- getOpacity: getOpacity,
- getRgbValue: getRgbValue,
- getRgbaValue: getRgbaValue,
- getColorFromRgbValue: getColorFromRgbValue
- };
- exports["default"] = _default;
- });
-
- unwrapExports(lib);
- var lib_1 = lib.getRgbValue;
- var lib_2 = lib.getRgbaValue;
- var lib_3 = lib.getOpacity;
- var lib_4 = lib.toRgb;
- var lib_5 = lib.toHex;
- var lib_6 = lib.getColorFromRgbValue;
- var lib_7 = lib.darken;
- var lib_8 = lib.lighten;
- var lib_9 = lib.fade;
-
- //
- var script$c = {
- name: 'DvBorderBox11',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- titleWidth: {
- type: Number,
- default: 250
- },
- title: {
- type: String,
- default: ''
- },
- backgroundColor: {
- type: String,
- default: 'transparent'
- }
- },
-
- data() {
- const id = uuid();
- return {
- ref: 'border-box-11',
- filterId: `border-box-11-filterId-${id}`,
- defaultColor: ['#8aaafb', '#1f33a2'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- },
-
- fade: lib_9
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$c = script$c;
-
- /* template */
- var __vue_render__$c = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-11" }, [
- _c(
- "svg",
- {
- staticClass: "dv-border-svg-container",
- attrs: { width: _vm.width, height: _vm.height }
- },
- [
- _c("defs", [
- _c(
- "filter",
- {
- attrs: {
- id: _vm.filterId,
- height: "150%",
- width: "150%",
- x: "-25%",
- y: "-25%"
- }
- },
- [
- _c("feMorphology", {
- attrs: {
- operator: "dilate",
- radius: "2",
- in: "SourceAlpha",
- result: "thicken"
- }
- }),
- _vm._v(" "),
- _c("feGaussianBlur", {
- attrs: { in: "thicken", stdDeviation: "3", result: "blurred" }
- }),
- _vm._v(" "),
- _c("feFlood", {
- attrs: {
- "flood-color": _vm.mergedColor[1],
- result: "glowColor"
- }
- }),
- _vm._v(" "),
- _c("feComposite", {
- attrs: {
- in: "glowColor",
- in2: "blurred",
- operator: "in",
- result: "softGlowColored"
- }
- }),
- _vm._v(" "),
- _c(
- "feMerge",
- [
- _c("feMergeNode", { attrs: { in: "softGlowColored" } }),
- _vm._v(" "),
- _c("feMergeNode", { attrs: { in: "SourceGraphic" } })
- ],
- 1
- )
- ],
- 1
- )
- ]),
- _vm._v(" "),
- _c("polygon", {
- attrs: {
- fill: _vm.backgroundColor,
- points:
- "\n 20, 32 " +
- (_vm.width * 0.5 - _vm.titleWidth / 2) +
- ", 32 " +
- (_vm.width * 0.5 - _vm.titleWidth / 2 + 20) +
- ", 53\n " +
- (_vm.width * 0.5 + _vm.titleWidth / 2 - 20) +
- ", 53 " +
- (_vm.width * 0.5 + _vm.titleWidth / 2) +
- ", 32\n " +
- (_vm.width - 20) +
- ", 32 " +
- (_vm.width - 8) +
- ", 48 " +
- (_vm.width - 8) +
- ", " +
- (_vm.height - 25) +
- " " +
- (_vm.width - 20) +
- ", " +
- (_vm.height - 8) +
- "\n 20, " +
- (_vm.height - 8) +
- " 8, " +
- (_vm.height - 25) +
- " 8, 50\n "
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[0],
- filter: "url(#" + _vm.filterId + ")",
- points:
- "\n " +
- (_vm.width - _vm.titleWidth) / 2 +
- ", 30\n 20, 30 7, 50 7, " +
- (50 + (_vm.height - 167) / 2) +
- "\n 13, " +
- (55 + (_vm.height - 167) / 2) +
- " 13, " +
- (135 + (_vm.height - 167) / 2) +
- "\n 7, " +
- (140 + (_vm.height - 167) / 2) +
- " 7, " +
- (_vm.height - 27) +
- "\n 20, " +
- (_vm.height - 7) +
- " " +
- (_vm.width - 20) +
- ", " +
- (_vm.height - 7) +
- " " +
- (_vm.width - 7) +
- ", " +
- (_vm.height - 27) +
- "\n " +
- (_vm.width - 7) +
- ", " +
- (140 + (_vm.height - 167) / 2) +
- " " +
- (_vm.width - 13) +
- ", " +
- (135 + (_vm.height - 167) / 2) +
- "\n " +
- (_vm.width - 13) +
- ", " +
- (55 + (_vm.height - 167) / 2) +
- " " +
- (_vm.width - 7) +
- ", " +
- (50 + (_vm.height - 167) / 2) +
- "\n " +
- (_vm.width - 7) +
- ", 50 " +
- (_vm.width - 20) +
- ", 30 " +
- (_vm.width + _vm.titleWidth) / 2 +
- ", 30\n " +
- ((_vm.width + _vm.titleWidth) / 2 - 20) +
- ", 7 " +
- ((_vm.width - _vm.titleWidth) / 2 + 20) +
- ", 7\n " +
- (_vm.width - _vm.titleWidth) / 2 +
- ", 30 " +
- ((_vm.width - _vm.titleWidth) / 2 + 20) +
- ", 52\n " +
- ((_vm.width + _vm.titleWidth) / 2 - 20) +
- ", 52 " +
- (_vm.width + _vm.titleWidth) / 2 +
- ", 30\n "
- }
- }),
- _vm._v(" "),
- _c("polygon", {
- attrs: {
- stroke: _vm.mergedColor[0],
- fill: "transparent",
- points:
- "\n " +
- ((_vm.width + _vm.titleWidth) / 2 - 5) +
- ", 30 " +
- ((_vm.width + _vm.titleWidth) / 2 - 21) +
- ", 11\n " +
- ((_vm.width + _vm.titleWidth) / 2 - 27) +
- ", 11 " +
- ((_vm.width + _vm.titleWidth) / 2 - 8) +
- ", 34\n "
- }
- }),
- _vm._v(" "),
- _c("polygon", {
- attrs: {
- stroke: _vm.mergedColor[0],
- fill: "transparent",
- points:
- "\n " +
- ((_vm.width - _vm.titleWidth) / 2 + 5) +
- ", 30 " +
- ((_vm.width - _vm.titleWidth) / 2 + 22) +
- ", 49\n " +
- ((_vm.width - _vm.titleWidth) / 2 + 28) +
- ", 49 " +
- ((_vm.width - _vm.titleWidth) / 2 + 8) +
- ", 26\n "
- }
- }),
- _vm._v(" "),
- _c("polygon", {
- attrs: {
- stroke: _vm.mergedColor[0],
- fill: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 30),
- filter: "url(#" + _vm.filterId + ")",
- points:
- "\n " +
- ((_vm.width + _vm.titleWidth) / 2 - 11) +
- ", 37 " +
- ((_vm.width + _vm.titleWidth) / 2 - 32) +
- ", 11\n " +
- ((_vm.width - _vm.titleWidth) / 2 + 23) +
- ", 11 " +
- ((_vm.width - _vm.titleWidth) / 2 + 11) +
- ", 23\n " +
- ((_vm.width - _vm.titleWidth) / 2 + 33) +
- ", 49 " +
- ((_vm.width + _vm.titleWidth) / 2 - 22) +
- ", 49\n "
- }
- }),
- _vm._v(" "),
- _c(
- "polygon",
- {
- attrs: {
- filter: "url(#" + _vm.filterId + ")",
- fill: _vm.mergedColor[0],
- opacity: "1",
- points:
- "\n " +
- ((_vm.width - _vm.titleWidth) / 2 - 10) +
- ", 37 " +
- ((_vm.width - _vm.titleWidth) / 2 - 31) +
- ", 37\n " +
- ((_vm.width - _vm.titleWidth) / 2 - 25) +
- ", 46 " +
- ((_vm.width - _vm.titleWidth) / 2 - 4) +
- ", 46\n "
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "opacity",
- values: "1;0.7;1",
- dur: "2s",
- begin: "0s",
- repeatCount: "indefinite"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "polygon",
- {
- attrs: {
- filter: "url(#" + _vm.filterId + ")",
- fill: _vm.mergedColor[0],
- opacity: "0.7",
- points:
- "\n " +
- ((_vm.width - _vm.titleWidth) / 2 - 40) +
- ", 37 " +
- ((_vm.width - _vm.titleWidth) / 2 - 61) +
- ", 37\n " +
- ((_vm.width - _vm.titleWidth) / 2 - 55) +
- ", 46 " +
- ((_vm.width - _vm.titleWidth) / 2 - 34) +
- ", 46\n "
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "opacity",
- values: "0.7;0.4;0.7",
- dur: "2s",
- begin: "0s",
- repeatCount: "indefinite"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "polygon",
- {
- attrs: {
- filter: "url(#" + _vm.filterId + ")",
- fill: _vm.mergedColor[0],
- opacity: "0.5",
- points:
- "\n " +
- ((_vm.width - _vm.titleWidth) / 2 - 70) +
- ", 37 " +
- ((_vm.width - _vm.titleWidth) / 2 - 91) +
- ", 37\n " +
- ((_vm.width - _vm.titleWidth) / 2 - 85) +
- ", 46 " +
- ((_vm.width - _vm.titleWidth) / 2 - 64) +
- ", 46\n "
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "opacity",
- values: "0.5;0.2;0.5",
- dur: "2s",
- begin: "0s",
- repeatCount: "indefinite"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "polygon",
- {
- attrs: {
- filter: "url(#" + _vm.filterId + ")",
- fill: _vm.mergedColor[0],
- opacity: "1",
- points:
- "\n " +
- ((_vm.width + _vm.titleWidth) / 2 + 30) +
- ", 37 " +
- ((_vm.width + _vm.titleWidth) / 2 + 9) +
- ", 37\n " +
- ((_vm.width + _vm.titleWidth) / 2 + 3) +
- ", 46 " +
- ((_vm.width + _vm.titleWidth) / 2 + 24) +
- ", 46\n "
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "opacity",
- values: "1;0.7;1",
- dur: "2s",
- begin: "0s",
- repeatCount: "indefinite"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "polygon",
- {
- attrs: {
- filter: "url(#" + _vm.filterId + ")",
- fill: _vm.mergedColor[0],
- opacity: "0.7",
- points:
- "\n " +
- ((_vm.width + _vm.titleWidth) / 2 + 60) +
- ", 37 " +
- ((_vm.width + _vm.titleWidth) / 2 + 39) +
- ", 37\n " +
- ((_vm.width + _vm.titleWidth) / 2 + 33) +
- ", 46 " +
- ((_vm.width + _vm.titleWidth) / 2 + 54) +
- ", 46\n "
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "opacity",
- values: "0.7;0.4;0.7",
- dur: "2s",
- begin: "0s",
- repeatCount: "indefinite"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "polygon",
- {
- attrs: {
- filter: "url(#" + _vm.filterId + ")",
- fill: _vm.mergedColor[0],
- opacity: "0.5",
- points:
- "\n " +
- ((_vm.width + _vm.titleWidth) / 2 + 90) +
- ", 37 " +
- ((_vm.width + _vm.titleWidth) / 2 + 69) +
- ", 37\n " +
- ((_vm.width + _vm.titleWidth) / 2 + 63) +
- ", 46 " +
- ((_vm.width + _vm.titleWidth) / 2 + 84) +
- ", 46\n "
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "opacity",
- values: "0.5;0.2;0.5",
- dur: "2s",
- begin: "0s",
- repeatCount: "indefinite"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "text",
- {
- staticClass: "dv-border-box-11-title",
- attrs: {
- x: "" + _vm.width / 2,
- y: "32",
- fill: "#fff",
- "font-size": "18",
- "text-anchor": "middle",
- "dominant-baseline": "middle"
- }
- },
- [_vm._v("\n " + _vm._s(_vm.title) + "\n ")]
- ),
- _vm._v(" "),
- _c("polygon", {
- attrs: {
- fill: _vm.mergedColor[0],
- filter: "url(#" + _vm.filterId + ")",
- points:
- "\n 7, " +
- (53 + (_vm.height - 167) / 2) +
- " 11, " +
- (57 + (_vm.height - 167) / 2) +
- "\n 11, " +
- (133 + (_vm.height - 167) / 2) +
- " 7, " +
- (137 + (_vm.height - 167) / 2) +
- "\n "
- }
- }),
- _vm._v(" "),
- _c("polygon", {
- attrs: {
- fill: _vm.mergedColor[0],
- filter: "url(#" + _vm.filterId + ")",
- points:
- "\n " +
- (_vm.width - 7) +
- ", " +
- (53 + (_vm.height - 167) / 2) +
- " " +
- (_vm.width - 11) +
- ", " +
- (57 + (_vm.height - 167) / 2) +
- "\n " +
- (_vm.width - 11) +
- ", " +
- (133 + (_vm.height - 167) / 2) +
- " " +
- (_vm.width - 7) +
- ", " +
- (137 + (_vm.height - 167) / 2) +
- "\n "
- }
- })
- ]
- ),
- _vm._v(" "),
- _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
- ])
- };
- var __vue_staticRenderFns__$c = [];
- __vue_render__$c._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$c = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$c = undefined;
- /* module identifier */
- const __vue_module_identifier__$c = undefined;
- /* functional template */
- const __vue_is_functional_template__$c = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$c = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$c, staticRenderFns: __vue_staticRenderFns__$c },
- __vue_inject_styles__$c,
- __vue_script__$c,
- __vue_scope_id__$c,
- __vue_is_functional_template__$c,
- __vue_module_identifier__$c,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function borderBox11 (Vue) {
- Vue.component(__vue_component__$c.name, __vue_component__$c);
- }
-
- //
- var script$d = {
- name: 'DvBorderBox12',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- backgroundColor: {
- type: String,
- default: 'transparent'
- }
- },
-
- data() {
- const id = uuid();
- return {
- ref: 'border-box-12',
- filterId: `borderr-box-12-filterId-${id}`,
- defaultColor: ['#2e6099', '#7ce7fd'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- },
-
- fade: lib_9
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$d = script$d;
-
- /* template */
- var __vue_render__$d = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-12" }, [
- _c(
- "svg",
- {
- staticClass: "dv-border-svg-container",
- attrs: { width: _vm.width, height: _vm.height }
- },
- [
- _c("defs", [
- _c(
- "filter",
- {
- attrs: {
- id: _vm.filterId,
- height: "150%",
- width: "150%",
- x: "-25%",
- y: "-25%"
- }
- },
- [
- _c("feMorphology", {
- attrs: {
- operator: "dilate",
- radius: "1",
- in: "SourceAlpha",
- result: "thicken"
- }
- }),
- _vm._v(" "),
- _c("feGaussianBlur", {
- attrs: { in: "thicken", stdDeviation: "2", result: "blurred" }
- }),
- _vm._v(" "),
- _c(
- "feFlood",
- {
- attrs: {
- "flood-color": _vm.fade(
- _vm.mergedColor[1] || _vm.defaultColor[1],
- 70
- ),
- result: "glowColor"
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "flood-color",
- values:
- "\n " +
- _vm.fade(
- _vm.mergedColor[1] || _vm.defaultColor[1],
- 70
- ) +
- ";\n " +
- _vm.fade(
- _vm.mergedColor[1] || _vm.defaultColor[1],
- 30
- ) +
- ";\n " +
- _vm.fade(
- _vm.mergedColor[1] || _vm.defaultColor[1],
- 70
- ) +
- ";\n ",
- dur: "3s",
- begin: "0s",
- repeatCount: "indefinite"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c("feComposite", {
- attrs: {
- in: "glowColor",
- in2: "blurred",
- operator: "in",
- result: "softGlowColored"
- }
- }),
- _vm._v(" "),
- _c(
- "feMerge",
- [
- _c("feMergeNode", { attrs: { in: "softGlowColored" } }),
- _vm._v(" "),
- _c("feMergeNode", { attrs: { in: "SourceGraphic" } })
- ],
- 1
- )
- ],
- 1
- )
- ]),
- _vm._v(" "),
- _vm.width && _vm.height
- ? _c("path", {
- attrs: {
- fill: _vm.backgroundColor,
- "stroke-width": "2",
- stroke: _vm.mergedColor[0],
- d:
- "\n M15 5 L " +
- (_vm.width - 15) +
- " 5 Q " +
- (_vm.width - 5) +
- " 5, " +
- (_vm.width - 5) +
- " 15\n L " +
- (_vm.width - 5) +
- " " +
- (_vm.height - 15) +
- " Q " +
- (_vm.width - 5) +
- " " +
- (_vm.height - 5) +
- ", " +
- (_vm.width - 15) +
- " " +
- (_vm.height - 5) +
- "\n L 15, " +
- (_vm.height - 5) +
- " Q 5 " +
- (_vm.height - 5) +
- " 5 " +
- (_vm.height - 15) +
- " L 5 15\n Q 5 5 15 5\n "
- }
- })
- : _vm._e(),
- _vm._v(" "),
- _c("path", {
- attrs: {
- "stroke-width": "2",
- fill: "transparent",
- "stroke-linecap": "round",
- filter: "url(#" + _vm.filterId + ")",
- stroke: _vm.mergedColor[1],
- d: "M 20 5 L 15 5 Q 5 5 5 15 L 5 20"
- }
- }),
- _vm._v(" "),
- _c("path", {
- attrs: {
- "stroke-width": "2",
- fill: "transparent",
- "stroke-linecap": "round",
- filter: "url(#" + _vm.filterId + ")",
- stroke: _vm.mergedColor[1],
- d:
- "M " +
- (_vm.width - 20) +
- " 5 L " +
- (_vm.width - 15) +
- " 5 Q " +
- (_vm.width - 5) +
- " 5 " +
- (_vm.width - 5) +
- " 15 L " +
- (_vm.width - 5) +
- " 20"
- }
- }),
- _vm._v(" "),
- _c("path", {
- attrs: {
- "stroke-width": "2",
- fill: "transparent",
- "stroke-linecap": "round",
- filter: "url(#" + _vm.filterId + ")",
- stroke: _vm.mergedColor[1],
- d:
- "\n M " +
- (_vm.width - 20) +
- " " +
- (_vm.height - 5) +
- " L " +
- (_vm.width - 15) +
- " " +
- (_vm.height - 5) +
- "\n Q " +
- (_vm.width - 5) +
- " " +
- (_vm.height - 5) +
- " " +
- (_vm.width - 5) +
- " " +
- (_vm.height - 15) +
- "\n L " +
- (_vm.width - 5) +
- " " +
- (_vm.height - 20) +
- "\n "
- }
- }),
- _vm._v(" "),
- _c("path", {
- attrs: {
- "stroke-width": "2",
- fill: "transparent",
- "stroke-linecap": "round",
- filter: "url(#" + _vm.filterId + ")",
- stroke: _vm.mergedColor[1],
- d:
- "\n M 20 " +
- (_vm.height - 5) +
- " L 15 " +
- (_vm.height - 5) +
- "\n Q 5 " +
- (_vm.height - 5) +
- " 5 " +
- (_vm.height - 15) +
- "\n L 5 " +
- (_vm.height - 20) +
- "\n "
- }
- })
- ]
- ),
- _vm._v(" "),
- _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
- ])
- };
- var __vue_staticRenderFns__$d = [];
- __vue_render__$d._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$d = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$d = undefined;
- /* module identifier */
- const __vue_module_identifier__$d = undefined;
- /* functional template */
- const __vue_is_functional_template__$d = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$d = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$d, staticRenderFns: __vue_staticRenderFns__$d },
- __vue_inject_styles__$d,
- __vue_script__$d,
- __vue_scope_id__$d,
- __vue_is_functional_template__$d,
- __vue_module_identifier__$d,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function borderBox12 (Vue) {
- Vue.component(__vue_component__$d.name, __vue_component__$d);
- }
-
- //
- var script$e = {
- name: 'DvBorderBox13',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- backgroundColor: {
- type: String,
- default: 'transparent'
- }
- },
-
- data() {
- return {
- ref: 'border-box-13',
- defaultColor: ['#6586ec', '#2cf7fe'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$e = script$e;
-
- /* template */
- var __vue_render__$e = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-border-box-13" }, [
- _c(
- "svg",
- {
- staticClass: "dv-border-svg-container",
- attrs: { width: _vm.width, height: _vm.height }
- },
- [
- _c("path", {
- attrs: {
- fill: _vm.backgroundColor,
- stroke: _vm.mergedColor[0],
- d:
- "\n M 5 20 L 5 10 L 12 3 L 60 3 L 68 10\n L " +
- (_vm.width - 20) +
- " 10 L " +
- (_vm.width - 5) +
- " 25\n L " +
- (_vm.width - 5) +
- " " +
- (_vm.height - 5) +
- " L 20 " +
- (_vm.height - 5) +
- "\n L 5 " +
- (_vm.height - 20) +
- " L 5 20\n "
- }
- }),
- _vm._v(" "),
- _c("path", {
- attrs: {
- fill: "transparent",
- "stroke-width": "3",
- "stroke-linecap": "round",
- "stroke-dasharray": "10, 5",
- stroke: _vm.mergedColor[0],
- d: "M 16 9 L 61 9"
- }
- }),
- _vm._v(" "),
- _c("path", {
- attrs: {
- fill: "transparent",
- stroke: _vm.mergedColor[1],
- d: "M 5 20 L 5 10 L 12 3 L 60 3 L 68 10"
- }
- }),
- _vm._v(" "),
- _c("path", {
- attrs: {
- fill: "transparent",
- stroke: _vm.mergedColor[1],
- d:
- "M " +
- (_vm.width - 5) +
- " " +
- (_vm.height - 30) +
- " L " +
- (_vm.width - 5) +
- " " +
- (_vm.height - 5) +
- " L " +
- (_vm.width - 30) +
- " " +
- (_vm.height - 5)
- }
- })
- ]
- ),
- _vm._v(" "),
- _c("div", { staticClass: "border-box-content" }, [_vm._t("default")], 2)
- ])
- };
- var __vue_staticRenderFns__$e = [];
- __vue_render__$e._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$e = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$e = undefined;
- /* module identifier */
- const __vue_module_identifier__$e = undefined;
- /* functional template */
- const __vue_is_functional_template__$e = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$e = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$e, staticRenderFns: __vue_staticRenderFns__$e },
- __vue_inject_styles__$e,
- __vue_script__$e,
- __vue_scope_id__$e,
- __vue_is_functional_template__$e,
- __vue_module_identifier__$e,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function borderBox13 (Vue) {
- Vue.component(__vue_component__$e.name, __vue_component__$e);
- }
-
- //
- var script$f = {
- name: 'DvDecoration1',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- }
- },
-
- data() {
- const pointSideLength = 2.5;
- return {
- ref: 'decoration-1',
- svgWH: [200, 50],
- svgScale: [1, 1],
- rowNum: 4,
- rowPoints: 20,
- pointSideLength,
- halfPointSideLength: pointSideLength / 2,
- points: [],
- rects: [],
- defaultColor: ['#fff', '#0de7c2'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- afterAutoResizeMixinInit() {
- const {
- calcSVGData
- } = this;
- calcSVGData();
- },
-
- calcSVGData() {
- const {
- calcPointsPosition,
- calcRectsPosition,
- calcScale
- } = this;
- calcPointsPosition();
- calcRectsPosition();
- calcScale();
- },
-
- calcPointsPosition() {
- const {
- svgWH,
- rowNum,
- rowPoints
- } = this;
- const [w, h] = svgWH;
- const horizontalGap = w / (rowPoints + 1);
- const verticalGap = h / (rowNum + 1);
- let points = new Array(rowNum).fill(0).map((foo, i) => new Array(rowPoints).fill(0).map((foo, j) => [horizontalGap * (j + 1), verticalGap * (i + 1)]));
- this.points = points.reduce((all, item) => [...all, ...item], []);
- },
-
- calcRectsPosition() {
- const {
- points,
- rowPoints
- } = this;
- const rect1 = points[rowPoints * 2 - 1];
- const rect2 = points[rowPoints * 2 - 3];
- this.rects = [rect1, rect2];
- },
-
- calcScale() {
- const {
- width,
- height,
- svgWH
- } = this;
- const [w, h] = svgWH;
- this.svgScale = [width / w, height / h];
- },
-
- onResize() {
- const {
- calcSVGData
- } = this;
- calcSVGData();
- },
-
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$f = script$f;
-
- /* template */
- var __vue_render__$f = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-1" }, [
- _c(
- "svg",
- {
- style:
- "transform:scale(" + _vm.svgScale[0] + "," + _vm.svgScale[1] + ");",
- attrs: { width: _vm.svgWH[0] + "px", height: _vm.svgWH[1] + "px" }
- },
- [
- _vm._l(_vm.points, function(point, i) {
- return [
- Math.random() > 0.6
- ? _c(
- "rect",
- {
- key: i,
- attrs: {
- fill: _vm.mergedColor[0],
- x: point[0] - _vm.halfPointSideLength,
- y: point[1] - _vm.halfPointSideLength,
- width: _vm.pointSideLength,
- height: _vm.pointSideLength
- }
- },
- [
- Math.random() > 0.6
- ? _c("animate", {
- attrs: {
- attributeName: "fill",
- values: _vm.mergedColor[0] + ";transparent",
- dur: "1s",
- begin: Math.random() * 2,
- repeatCount: "indefinite"
- }
- })
- : _vm._e()
- ]
- )
- : _vm._e()
- ]
- }),
- _vm._v(" "),
- _vm.rects[0]
- ? _c(
- "rect",
- {
- attrs: {
- fill: _vm.mergedColor[1],
- x: _vm.rects[0][0] - _vm.pointSideLength,
- y: _vm.rects[0][1] - _vm.pointSideLength,
- width: _vm.pointSideLength * 2,
- height: _vm.pointSideLength * 2
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "width",
- values: "0;" + _vm.pointSideLength * 2,
- dur: "2s",
- repeatCount: "indefinite"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "height",
- values: "0;" + _vm.pointSideLength * 2,
- dur: "2s",
- repeatCount: "indefinite"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "x",
- values:
- _vm.rects[0][0] +
- ";" +
- (_vm.rects[0][0] - _vm.pointSideLength),
- dur: "2s",
- repeatCount: "indefinite"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "y",
- values:
- _vm.rects[0][1] +
- ";" +
- (_vm.rects[0][1] - _vm.pointSideLength),
- dur: "2s",
- repeatCount: "indefinite"
- }
- })
- ]
- )
- : _vm._e(),
- _vm._v(" "),
- _vm.rects[1]
- ? _c(
- "rect",
- {
- attrs: {
- fill: _vm.mergedColor[1],
- x: _vm.rects[1][0] - 40,
- y: _vm.rects[1][1] - _vm.pointSideLength,
- width: 40,
- height: _vm.pointSideLength * 2
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "width",
- values: "0;40;0",
- dur: "2s",
- repeatCount: "indefinite"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "x",
- values:
- _vm.rects[1][0] +
- ";" +
- (_vm.rects[1][0] - 40) +
- ";" +
- _vm.rects[1][0],
- dur: "2s",
- repeatCount: "indefinite"
- }
- })
- ]
- )
- : _vm._e()
- ],
- 2
- )
- ])
- };
- var __vue_staticRenderFns__$f = [];
- __vue_render__$f._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$f = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$f = undefined;
- /* module identifier */
- const __vue_module_identifier__$f = undefined;
- /* functional template */
- const __vue_is_functional_template__$f = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$f = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$f, staticRenderFns: __vue_staticRenderFns__$f },
- __vue_inject_styles__$f,
- __vue_script__$f,
- __vue_scope_id__$f,
- __vue_is_functional_template__$f,
- __vue_module_identifier__$f,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function decoration1 (Vue) {
- Vue.component(__vue_component__$f.name, __vue_component__$f);
- }
-
- //
- var script$g = {
- name: 'DvDecoration2',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- reverse: {
- type: Boolean,
- default: false
- },
- dur: {
- type: Number,
- default: 6
- }
- },
-
- data() {
- return {
- ref: 'decoration-2',
- x: 0,
- y: 0,
- w: 0,
- h: 0,
- defaultColor: ['#3faacb', '#fff'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- },
-
- reverse() {
- const {
- calcSVGData
- } = this;
- calcSVGData();
- }
-
- },
- methods: {
- afterAutoResizeMixinInit() {
- const {
- calcSVGData
- } = this;
- calcSVGData();
- },
-
- calcSVGData() {
- const {
- reverse,
- width,
- height
- } = this;
-
- if (reverse) {
- this.w = 1;
- this.h = height;
- this.x = width / 2;
- this.y = 0;
- } else {
- this.w = width;
- this.h = 1;
- this.x = 0;
- this.y = height / 2;
- }
- },
-
- onResize() {
- const {
- calcSVGData
- } = this;
- calcSVGData();
- },
-
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$g = script$g;
-
- /* template */
- var __vue_render__$g = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-2" }, [
- _c(
- "svg",
- { attrs: { width: _vm.width + "px", height: _vm.height + "px" } },
- [
- _c(
- "rect",
- {
- attrs: {
- x: _vm.x,
- y: _vm.y,
- width: _vm.w,
- height: _vm.h,
- fill: _vm.mergedColor[0]
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: _vm.reverse ? "height" : "width",
- from: "0",
- to: _vm.reverse ? _vm.height : _vm.width,
- dur: _vm.dur + "s",
- calcMode: "spline",
- keyTimes: "0;1",
- keySplines: ".42,0,.58,1",
- repeatCount: "indefinite"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "rect",
- {
- attrs: {
- x: _vm.x,
- y: _vm.y,
- width: "1",
- height: "1",
- fill: _vm.mergedColor[1]
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: _vm.reverse ? "y" : "x",
- from: "0",
- to: _vm.reverse ? _vm.height : _vm.width,
- dur: _vm.dur + "s",
- calcMode: "spline",
- keyTimes: "0;1",
- keySplines: "0.42,0,0.58,1",
- repeatCount: "indefinite"
- }
- })
- ]
- )
- ]
- )
- ])
- };
- var __vue_staticRenderFns__$g = [];
- __vue_render__$g._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$g = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$g = undefined;
- /* module identifier */
- const __vue_module_identifier__$g = undefined;
- /* functional template */
- const __vue_is_functional_template__$g = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$g = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$g, staticRenderFns: __vue_staticRenderFns__$g },
- __vue_inject_styles__$g,
- __vue_script__$g,
- __vue_scope_id__$g,
- __vue_is_functional_template__$g,
- __vue_module_identifier__$g,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function decoration2 (Vue) {
- Vue.component(__vue_component__$g.name, __vue_component__$g);
- }
-
- //
- var script$h = {
- name: 'DvDecoration3',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- }
- },
-
- data() {
- const pointSideLength = 7;
- return {
- ref: 'decoration-3',
- svgWH: [300, 35],
- svgScale: [1, 1],
- rowNum: 2,
- rowPoints: 25,
- pointSideLength,
- halfPointSideLength: pointSideLength / 2,
- points: [],
- defaultColor: ['#7acaec', 'transparent'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- afterAutoResizeMixinInit() {
- const {
- calcSVGData
- } = this;
- calcSVGData();
- },
-
- calcSVGData() {
- const {
- calcPointsPosition,
- calcScale
- } = this;
- calcPointsPosition();
- calcScale();
- },
-
- calcPointsPosition() {
- const {
- svgWH,
- rowNum,
- rowPoints
- } = this;
- const [w, h] = svgWH;
- const horizontalGap = w / (rowPoints + 1);
- const verticalGap = h / (rowNum + 1);
- let points = new Array(rowNum).fill(0).map((foo, i) => new Array(rowPoints).fill(0).map((foo, j) => [horizontalGap * (j + 1), verticalGap * (i + 1)]));
- this.points = points.reduce((all, item) => [...all, ...item], []);
- },
-
- calcScale() {
- const {
- width,
- height,
- svgWH
- } = this;
- const [w, h] = svgWH;
- this.svgScale = [width / w, height / h];
- },
-
- onResize() {
- const {
- calcSVGData
- } = this;
- calcSVGData();
- },
-
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$h = script$h;
-
- /* template */
- var __vue_render__$h = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-3" }, [
- _c(
- "svg",
- {
- style:
- "transform:scale(" + _vm.svgScale[0] + "," + _vm.svgScale[1] + ");",
- attrs: { width: _vm.svgWH[0] + "px", height: _vm.svgWH[1] + "px" }
- },
- [
- _vm._l(_vm.points, function(point, i) {
- return [
- _c(
- "rect",
- {
- key: i,
- attrs: {
- fill: _vm.mergedColor[0],
- x: point[0] - _vm.halfPointSideLength,
- y: point[1] - _vm.halfPointSideLength,
- width: _vm.pointSideLength,
- height: _vm.pointSideLength
- }
- },
- [
- Math.random() > 0.6
- ? _c("animate", {
- attrs: {
- attributeName: "fill",
- values: "" + _vm.mergedColor.join(";"),
- dur: Math.random() + 1 + "s",
- begin: Math.random() * 2,
- repeatCount: "indefinite"
- }
- })
- : _vm._e()
- ]
- )
- ]
- })
- ],
- 2
- )
- ])
- };
- var __vue_staticRenderFns__$h = [];
- __vue_render__$h._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$h = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$h = undefined;
- /* module identifier */
- const __vue_module_identifier__$h = undefined;
- /* functional template */
- const __vue_is_functional_template__$h = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$h = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$h, staticRenderFns: __vue_staticRenderFns__$h },
- __vue_inject_styles__$h,
- __vue_script__$h,
- __vue_scope_id__$h,
- __vue_is_functional_template__$h,
- __vue_module_identifier__$h,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function decoration3 (Vue) {
- Vue.component(__vue_component__$h.name, __vue_component__$h);
- }
-
- //
- var script$i = {
- name: 'DvDecoration4',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- reverse: {
- type: Boolean,
- default: false
- },
- dur: {
- type: Number,
- default: 3
- }
- },
-
- data() {
- return {
- ref: 'decoration-4',
- defaultColor: ['rgba(255, 255, 255, 0.3)', 'rgba(255, 255, 255, 0.3)'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$i = script$i;
-
- /* template */
- var __vue_render__$i = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-4" }, [
- _c(
- "div",
- {
- class: "container " + (_vm.reverse ? "reverse" : "normal"),
- style: _vm.reverse
- ? "width:" +
- _vm.width +
- "px;height:5px;animation-duration:" +
- _vm.dur +
- "s"
- : "width:5px;height:" +
- _vm.height +
- "px;animation-duration:" +
- _vm.dur +
- "s"
- },
- [
- _c(
- "svg",
- {
- attrs: {
- width: _vm.reverse ? _vm.width : 5,
- height: _vm.reverse ? 5 : _vm.height
- }
- },
- [
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[0],
- points: _vm.reverse
- ? "0, 2.5 " + _vm.width + ", 2.5"
- : "2.5, 0 2.5, " + _vm.height
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- staticClass: "bold-line",
- attrs: {
- stroke: _vm.mergedColor[1],
- "stroke-width": "3",
- "stroke-dasharray": "20, 80",
- "stroke-dashoffset": "-30",
- points: _vm.reverse
- ? "0, 2.5 " + _vm.width + ", 2.5"
- : "2.5, 0 2.5, " + _vm.height
- }
- })
- ]
- )
- ]
- )
- ])
- };
- var __vue_staticRenderFns__$i = [];
- __vue_render__$i._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$i = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$i = undefined;
- /* module identifier */
- const __vue_module_identifier__$i = undefined;
- /* functional template */
- const __vue_is_functional_template__$i = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$i = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$i, staticRenderFns: __vue_staticRenderFns__$i },
- __vue_inject_styles__$i,
- __vue_script__$i,
- __vue_scope_id__$i,
- __vue_is_functional_template__$i,
- __vue_module_identifier__$i,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function decoration4 (Vue) {
- Vue.component(__vue_component__$i.name, __vue_component__$i);
- }
-
- //
- var script$j = {
- name: 'DvDecoration5',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- dur: {
- type: Number,
- default: 1.2
- }
- },
-
- data() {
- return {
- ref: 'decoration-5',
- line1Points: '',
- line2Points: '',
- line1Length: 0,
- line2Length: 0,
- defaultColor: ['#3f96a5', '#3f96a5'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- afterAutoResizeMixinInit() {
- const {
- calcSVGData
- } = this;
- calcSVGData();
- },
-
- calcSVGData() {
- const {
- width,
- height
- } = this;
- 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]];
- let line2Points = [[width * 0.3, height * 0.8], [width * 0.7, height * 0.8]];
- const line1Length = util_7$1(line1Points);
- const line2Length = util_7$1(line2Points);
- line1Points = line1Points.map(point => point.join(',')).join(' ');
- line2Points = line2Points.map(point => point.join(',')).join(' ');
- this.line1Points = line1Points;
- this.line2Points = line2Points;
- this.line1Length = line1Length;
- this.line2Length = line2Length;
- },
-
- onResize() {
- const {
- calcSVGData
- } = this;
- calcSVGData();
- },
-
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$j = script$j;
-
- /* template */
- var __vue_render__$j = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-5" }, [
- _c("svg", { attrs: { width: _vm.width, height: _vm.height } }, [
- _c(
- "polyline",
- {
- attrs: {
- fill: "transparent",
- stroke: _vm.mergedColor[0],
- "stroke-width": "3",
- points: _vm.line1Points
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "stroke-dasharray",
- attributeType: "XML",
- from: "0, " + _vm.line1Length / 2 + ", 0, " + _vm.line1Length / 2,
- to: "0, 0, " + _vm.line1Length + ", 0",
- dur: _vm.dur + "s",
- begin: "0s",
- calcMode: "spline",
- keyTimes: "0;1",
- keySplines: "0.4,1,0.49,0.98",
- repeatCount: "indefinite"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "polyline",
- {
- attrs: {
- fill: "transparent",
- stroke: _vm.mergedColor[1],
- "stroke-width": "2",
- points: _vm.line2Points
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "stroke-dasharray",
- attributeType: "XML",
- from: "0, " + _vm.line2Length / 2 + ", 0, " + _vm.line2Length / 2,
- to: "0, 0, " + _vm.line2Length + ", 0",
- dur: _vm.dur + "s",
- begin: "0s",
- calcMode: "spline",
- keyTimes: "0;1",
- keySplines: ".4,1,.49,.98",
- repeatCount: "indefinite"
- }
- })
- ]
- )
- ])
- ])
- };
- var __vue_staticRenderFns__$j = [];
- __vue_render__$j._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$j = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$j = undefined;
- /* module identifier */
- const __vue_module_identifier__$j = undefined;
- /* functional template */
- const __vue_is_functional_template__$j = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$j = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$j, staticRenderFns: __vue_staticRenderFns__$j },
- __vue_inject_styles__$j,
- __vue_script__$j,
- __vue_scope_id__$j,
- __vue_is_functional_template__$j,
- __vue_module_identifier__$j,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function decoration5 (Vue) {
- Vue.component(__vue_component__$j.name, __vue_component__$j);
- }
-
- //
- var script$k = {
- name: 'DvDecoration6',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- }
- },
-
- data() {
- const rectWidth = 7;
- return {
- ref: 'decoration-6',
- svgWH: [300, 35],
- svgScale: [1, 1],
- rowNum: 1,
- rowPoints: 40,
- rectWidth,
- halfRectWidth: rectWidth / 2,
- points: [],
- heights: [],
- minHeights: [],
- randoms: [],
- defaultColor: ['#7acaec', '#7acaec'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- afterAutoResizeMixinInit() {
- const {
- calcSVGData
- } = this;
- calcSVGData();
- },
-
- calcSVGData() {
- const {
- calcPointsPosition,
- calcScale
- } = this;
- calcPointsPosition();
- calcScale();
- },
-
- calcPointsPosition() {
- const {
- svgWH,
- rowNum,
- rowPoints
- } = this;
- const [w, h] = svgWH;
- const horizontalGap = w / (rowPoints + 1);
- const verticalGap = h / (rowNum + 1);
- let points = new Array(rowNum).fill(0).map((foo, i) => new Array(rowPoints).fill(0).map((foo, j) => [horizontalGap * (j + 1), verticalGap * (i + 1)]));
- this.points = points.reduce((all, item) => [...all, ...item], []);
- 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));
- this.minHeights = new Array(rowNum * rowPoints).fill(0).map((foo, i) => heights[i] * Math.random());
- this.randoms = new Array(rowNum * rowPoints).fill(0).map(foo => Math.random() + 1.5);
- },
-
- calcScale() {
- const {
- width,
- height,
- svgWH
- } = this;
- const [w, h] = svgWH;
- this.svgScale = [width / w, height / h];
- },
-
- onResize() {
- const {
- calcSVGData
- } = this;
- calcSVGData();
- },
-
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$k = script$k;
-
- /* template */
- var __vue_render__$k = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-6" }, [
- _c(
- "svg",
- {
- style:
- "transform:scale(" + _vm.svgScale[0] + "," + _vm.svgScale[1] + ");",
- attrs: { width: _vm.svgWH[0] + "px", height: _vm.svgWH[1] + "px" }
- },
- [
- _vm._l(_vm.points, function(point, i) {
- return [
- _c(
- "rect",
- {
- key: i,
- attrs: {
- fill: _vm.mergedColor[Math.random() > 0.5 ? 0 : 1],
- x: point[0] - _vm.halfRectWidth,
- y: point[1] - _vm.heights[i] / 2,
- width: _vm.rectWidth,
- height: _vm.heights[i]
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "y",
- values:
- point[1] -
- _vm.minHeights[i] / 2 +
- ";" +
- (point[1] - _vm.heights[i] / 2) +
- ";" +
- (point[1] - _vm.minHeights[i] / 2),
- dur: _vm.randoms[i] + "s",
- keyTimes: "0;0.5;1",
- calcMode: "spline",
- keySplines: "0.42,0,0.58,1;0.42,0,0.58,1",
- begin: "0s",
- repeatCount: "indefinite"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "height",
- values:
- _vm.minHeights[i] +
- ";" +
- _vm.heights[i] +
- ";" +
- _vm.minHeights[i],
- dur: _vm.randoms[i] + "s",
- keyTimes: "0;0.5;1",
- calcMode: "spline",
- keySplines: "0.42,0,0.58,1;0.42,0,0.58,1",
- begin: "0s",
- repeatCount: "indefinite"
- }
- })
- ]
- )
- ]
- })
- ],
- 2
- )
- ])
- };
- var __vue_staticRenderFns__$k = [];
- __vue_render__$k._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$k = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$k = undefined;
- /* module identifier */
- const __vue_module_identifier__$k = undefined;
- /* functional template */
- const __vue_is_functional_template__$k = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$k = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$k, staticRenderFns: __vue_staticRenderFns__$k },
- __vue_inject_styles__$k,
- __vue_script__$k,
- __vue_scope_id__$k,
- __vue_is_functional_template__$k,
- __vue_module_identifier__$k,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function decoration6 (Vue) {
- Vue.component(__vue_component__$k.name, __vue_component__$k);
- }
-
- //
- var script$l = {
- name: 'DvDecoration7',
- props: {
- color: {
- type: Array,
- default: () => []
- }
- },
-
- data() {
- return {
- defaultColor: ['#1dc1f5', '#1dc1f5'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$l = script$l;
-
- /* template */
- var __vue_render__$l = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c(
- "div",
- { staticClass: "dv-decoration-7" },
- [
- _c("svg", { attrs: { width: "21px", height: "20px" } }, [
- _c("polyline", {
- attrs: {
- "stroke-width": "4",
- fill: "transparent",
- stroke: _vm.mergedColor[0],
- points: "10, 0 19, 10 10, 20"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- "stroke-width": "2",
- fill: "transparent",
- stroke: _vm.mergedColor[1],
- points: "2, 0 11, 10 2, 20"
- }
- })
- ]),
- _vm._v(" "),
- _vm._t("default"),
- _vm._v(" "),
- _c("svg", { attrs: { width: "21px", height: "20px" } }, [
- _c("polyline", {
- attrs: {
- "stroke-width": "4",
- fill: "transparent",
- stroke: _vm.mergedColor[0],
- points: "11, 0 2, 10 11, 20"
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- "stroke-width": "2",
- fill: "transparent",
- stroke: _vm.mergedColor[1],
- points: "19, 0 10, 10 19, 20"
- }
- })
- ])
- ],
- 2
- )
- };
- var __vue_staticRenderFns__$l = [];
- __vue_render__$l._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$l = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$l = undefined;
- /* module identifier */
- const __vue_module_identifier__$l = undefined;
- /* functional template */
- const __vue_is_functional_template__$l = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$l = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$l, staticRenderFns: __vue_staticRenderFns__$l },
- __vue_inject_styles__$l,
- __vue_script__$l,
- __vue_scope_id__$l,
- __vue_is_functional_template__$l,
- __vue_module_identifier__$l,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function decoration7 (Vue) {
- Vue.component(__vue_component__$l.name, __vue_component__$l);
- }
-
- //
- var script$m = {
- name: 'DvDecoration8',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- reverse: {
- type: Boolean,
- default: false
- }
- },
-
- data() {
- return {
- ref: 'decoration-8',
- defaultColor: ['#3f96a5', '#3f96a5'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- xPos(pos) {
- const {
- reverse,
- width
- } = this;
- if (!reverse) return pos;
- return width - pos;
- },
-
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$m = script$m;
-
- /* template */
- var __vue_render__$m = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-8" }, [
- _c("svg", { attrs: { width: _vm.width, height: _vm.height } }, [
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[0],
- "stroke-width": "2",
- fill: "transparent",
- points: _vm.xPos(0) + ", 0 " + _vm.xPos(30) + ", " + _vm.height / 2
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[0],
- "stroke-width": "2",
- fill: "transparent",
- points:
- _vm.xPos(20) +
- ", 0 " +
- _vm.xPos(50) +
- ", " +
- _vm.height / 2 +
- " " +
- _vm.xPos(_vm.width) +
- ", " +
- _vm.height / 2
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[1],
- fill: "transparent",
- "stroke-width": "3",
- points:
- _vm.xPos(0) +
- ", " +
- (_vm.height - 3) +
- ", " +
- _vm.xPos(200) +
- ", " +
- (_vm.height - 3)
- }
- })
- ])
- ])
- };
- var __vue_staticRenderFns__$m = [];
- __vue_render__$m._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$m = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$m = undefined;
- /* module identifier */
- const __vue_module_identifier__$m = undefined;
- /* functional template */
- const __vue_is_functional_template__$m = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$m = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$m, staticRenderFns: __vue_staticRenderFns__$m },
- __vue_inject_styles__$m,
- __vue_script__$m,
- __vue_scope_id__$m,
- __vue_is_functional_template__$m,
- __vue_module_identifier__$m,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function decoration8 (Vue) {
- Vue.component(__vue_component__$m.name, __vue_component__$m);
- }
-
- //
- var script$n = {
- name: 'DvDecoration9',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
- dur: {
- type: Number,
- default: 3
- }
- },
-
- data() {
- const id = uuid();
- return {
- ref: 'decoration-9',
- polygonId: `decoration-9-polygon-${id}`,
- svgWH: [100, 100],
- svgScale: [1, 1],
- defaultColor: ['rgba(3, 166, 224, 0.8)', 'rgba(3, 166, 224, 0.5)'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- afterAutoResizeMixinInit() {
- const {
- calcScale
- } = this;
- calcScale();
- },
-
- calcScale() {
- const {
- width,
- height,
- svgWH
- } = this;
- const [w, h] = svgWH;
- this.svgScale = [width / w, height / h];
- },
-
- onResize() {
- const {
- calcScale
- } = this;
- calcScale();
- },
-
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- },
-
- fade: lib_9
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$n = script$n;
-
- /* template */
- var __vue_render__$n = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c(
- "div",
- { ref: _vm.ref, staticClass: "dv-decoration-9" },
- [
- _c(
- "svg",
- {
- style:
- "transform:scale(" + _vm.svgScale[0] + "," + _vm.svgScale[1] + ");",
- attrs: { width: _vm.svgWH[0] + "px", height: _vm.svgWH[1] + "px" }
- },
- [
- _c("defs", [
- _c("polygon", {
- attrs: {
- id: _vm.polygonId,
- points: "15, 46.5, 21, 47.5, 21, 52.5, 15, 53.5"
- }
- })
- ]),
- _vm._v(" "),
- _c(
- "circle",
- {
- attrs: {
- cx: "50",
- cy: "50",
- r: "45",
- fill: "transparent",
- stroke: _vm.mergedColor[1],
- "stroke-width": "10",
- "stroke-dasharray": "80, 100, 30, 100"
- }
- },
- [
- _c("animateTransform", {
- attrs: {
- attributeName: "transform",
- type: "rotate",
- values: "0 50 50;360 50 50",
- dur: _vm.dur + "s",
- repeatCount: "indefinite"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "circle",
- {
- attrs: {
- cx: "50",
- cy: "50",
- r: "45",
- fill: "transparent",
- stroke: _vm.mergedColor[0],
- "stroke-width": "6",
- "stroke-dasharray": "50, 66, 100, 66"
- }
- },
- [
- _c("animateTransform", {
- attrs: {
- attributeName: "transform",
- type: "rotate",
- values: "0 50 50;-360 50 50",
- dur: _vm.dur + "s",
- repeatCount: "indefinite"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c("circle", {
- attrs: {
- cx: "50",
- cy: "50",
- r: "38",
- fill: "transparent",
- stroke: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 30),
- "stroke-width": "1",
- "stroke-dasharray": "5, 1"
- }
- }),
- _vm._v(" "),
- _vm._l(new Array(20).fill(0), function(foo, i) {
- return _c(
- "use",
- {
- key: i,
- attrs: {
- "xlink:href": "#" + _vm.polygonId,
- stroke: _vm.mergedColor[1],
- fill: Math.random() > 0.4 ? "transparent" : _vm.mergedColor[0]
- }
- },
- [
- _c("animateTransform", {
- attrs: {
- attributeName: "transform",
- type: "rotate",
- values: "0 50 50;360 50 50",
- dur: _vm.dur + "s",
- begin: (i * _vm.dur) / 20 + "s",
- repeatCount: "indefinite"
- }
- })
- ],
- 1
- )
- }),
- _vm._v(" "),
- _c("circle", {
- attrs: {
- cx: "50",
- cy: "50",
- r: "26",
- fill: "transparent",
- stroke: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 30),
- "stroke-width": "1",
- "stroke-dasharray": "5, 1"
- }
- })
- ],
- 2
- ),
- _vm._v(" "),
- _vm._t("default")
- ],
- 2
- )
- };
- var __vue_staticRenderFns__$n = [];
- __vue_render__$n._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$n = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$n = undefined;
- /* module identifier */
- const __vue_module_identifier__$n = undefined;
- /* functional template */
- const __vue_is_functional_template__$n = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$n = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$n, staticRenderFns: __vue_staticRenderFns__$n },
- __vue_inject_styles__$n,
- __vue_script__$n,
- __vue_scope_id__$n,
- __vue_is_functional_template__$n,
- __vue_module_identifier__$n,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function decoration9 (Vue) {
- Vue.component(__vue_component__$n.name, __vue_component__$n);
- }
-
- //
- var script$o = {
- name: 'DvDecoration10',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- }
- },
-
- data() {
- const id = uuid();
- return {
- ref: 'decoration-10',
- animationId1: `d10ani1${id}`,
- animationId2: `d10ani2${id}`,
- animationId3: `d10ani3${id}`,
- animationId4: `d10ani4${id}`,
- animationId5: `d10ani5${id}`,
- animationId6: `d10ani6${id}`,
- animationId7: `d10ani7${id}`,
- defaultColor: ['#00c2ff', 'rgba(0, 194, 255, 0.3)'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- }
-
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$o = script$o;
-
- /* template */
- var __vue_render__$o = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-10" }, [
- _c("svg", { attrs: { width: _vm.width, height: _vm.height } }, [
- _c("polyline", {
- attrs: {
- stroke: _vm.mergedColor[1],
- "stroke-width": "2",
- points:
- "0, " + _vm.height / 2 + " " + _vm.width + ", " + _vm.height / 2
- }
- }),
- _vm._v(" "),
- _c(
- "polyline",
- {
- attrs: {
- stroke: _vm.mergedColor[0],
- "stroke-width": "2",
- points:
- "5, " +
- _vm.height / 2 +
- " " +
- (_vm.width * 0.2 - 3) +
- ", " +
- _vm.height / 2,
- "stroke-dasharray": "0, " + _vm.width * 0.2,
- fill: "freeze"
- }
- },
- [
- _c("animate", {
- attrs: {
- id: _vm.animationId2,
- attributeName: "stroke-dasharray",
- values: "0, " + _vm.width * 0.2 + ";" + _vm.width * 0.2 + ", 0;",
- dur: "3s",
- begin: _vm.animationId1 + ".end",
- fill: "freeze"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "stroke-dasharray",
- values: _vm.width * 0.2 + ", 0;0, " + _vm.width * 0.2,
- dur: "0.01s",
- begin: _vm.animationId7 + ".end",
- fill: "freeze"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "polyline",
- {
- attrs: {
- stroke: _vm.mergedColor[0],
- "stroke-width": "2",
- points:
- _vm.width * 0.2 +
- 3 +
- ", " +
- _vm.height / 2 +
- " " +
- (_vm.width * 0.8 - 3) +
- ", " +
- _vm.height / 2,
- "stroke-dasharray": "0, " + _vm.width * 0.6
- }
- },
- [
- _c("animate", {
- attrs: {
- id: _vm.animationId4,
- attributeName: "stroke-dasharray",
- values: "0, " + _vm.width * 0.6 + ";" + _vm.width * 0.6 + ", 0",
- dur: "3s",
- begin: _vm.animationId3 + ".end + 1s",
- fill: "freeze"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "stroke-dasharray",
- values: _vm.width * 0.6 + ", 0;0, " + _vm.width * 0.6,
- dur: "0.01s",
- begin: _vm.animationId7 + ".end",
- fill: "freeze"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "polyline",
- {
- attrs: {
- stroke: _vm.mergedColor[0],
- "stroke-width": "2",
- points:
- _vm.width * 0.8 +
- 3 +
- ", " +
- _vm.height / 2 +
- " " +
- (_vm.width - 5) +
- ", " +
- _vm.height / 2,
- "stroke-dasharray": "0, " + _vm.width * 0.2
- }
- },
- [
- _c("animate", {
- attrs: {
- id: _vm.animationId6,
- attributeName: "stroke-dasharray",
- values: "0, " + _vm.width * 0.2 + ";" + _vm.width * 0.2 + ", 0",
- dur: "3s",
- begin: _vm.animationId5 + ".end + 1s",
- fill: "freeze"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "stroke-dasharray",
- values: _vm.width * 0.2 + ", 0;0, " + _vm.width * 0.3,
- dur: "0.01s",
- begin: _vm.animationId7 + ".end",
- fill: "freeze"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "circle",
- {
- attrs: {
- cx: "2",
- cy: _vm.height / 2,
- r: "2",
- fill: _vm.mergedColor[1]
- }
- },
- [
- _c("animate", {
- attrs: {
- id: _vm.animationId1,
- attributeName: "fill",
- values: _vm.mergedColor[1] + ";" + _vm.mergedColor[0],
- begin: "0s;" + _vm.animationId7 + ".end",
- dur: "0.3s",
- fill: "freeze"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "circle",
- {
- attrs: {
- cx: _vm.width * 0.2,
- cy: _vm.height / 2,
- r: "2",
- fill: _vm.mergedColor[1]
- }
- },
- [
- _c("animate", {
- attrs: {
- id: _vm.animationId3,
- attributeName: "fill",
- values: _vm.mergedColor[1] + ";" + _vm.mergedColor[0],
- begin: _vm.animationId2 + ".end",
- dur: "0.3s",
- fill: "freeze"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "fill",
- values: _vm.mergedColor[1] + ";" + _vm.mergedColor[1],
- dur: "0.01s",
- begin: _vm.animationId7 + ".end",
- fill: "freeze"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "circle",
- {
- attrs: {
- cx: _vm.width * 0.8,
- cy: _vm.height / 2,
- r: "2",
- fill: _vm.mergedColor[1]
- }
- },
- [
- _c("animate", {
- attrs: {
- id: _vm.animationId5,
- attributeName: "fill",
- values: _vm.mergedColor[1] + ";" + _vm.mergedColor[0],
- begin: _vm.animationId4 + ".end",
- dur: "0.3s",
- fill: "freeze"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "fill",
- values: _vm.mergedColor[1] + ";" + _vm.mergedColor[1],
- dur: "0.01s",
- begin: _vm.animationId7 + ".end",
- fill: "freeze"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "circle",
- {
- attrs: {
- cx: _vm.width - 2,
- cy: _vm.height / 2,
- r: "2",
- fill: _vm.mergedColor[1]
- }
- },
- [
- _c("animate", {
- attrs: {
- id: _vm.animationId7,
- attributeName: "fill",
- values: _vm.mergedColor[1] + ";" + _vm.mergedColor[0],
- begin: _vm.animationId6 + ".end",
- dur: "0.3s",
- fill: "freeze"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "fill",
- values: _vm.mergedColor[1] + ";" + _vm.mergedColor[1],
- dur: "0.01s",
- begin: _vm.animationId7 + ".end",
- fill: "freeze"
- }
- })
- ]
- )
- ])
- ])
- };
- var __vue_staticRenderFns__$o = [];
- __vue_render__$o._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$o = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$o = undefined;
- /* module identifier */
- const __vue_module_identifier__$o = undefined;
- /* functional template */
- const __vue_is_functional_template__$o = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$o = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$o, staticRenderFns: __vue_staticRenderFns__$o },
- __vue_inject_styles__$o,
- __vue_script__$o,
- __vue_scope_id__$o,
- __vue_is_functional_template__$o,
- __vue_module_identifier__$o,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function decoration10 (Vue) {
- Vue.component(__vue_component__$o.name, __vue_component__$o);
- }
-
- //
- var script$p = {
- name: 'DvDecoration11',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- }
- },
-
- data() {
- return {
- ref: 'decoration-11',
- defaultColor: ['#1a98fc', '#2cf7fe'],
- mergedColor: []
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- methods: {
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- },
-
- fade: lib_9
- },
-
- mounted() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- };
-
- /* script */
- const __vue_script__$p = script$p;
-
- /* template */
- var __vue_render__$p = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-11" }, [
- _c("svg", { attrs: { width: _vm.width, height: _vm.height } }, [
- _c("polygon", {
- attrs: {
- fill: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 10),
- stroke: _vm.mergedColor[1],
- points: "20 10, 25 4, 55 4 60 10"
- }
- }),
- _vm._v(" "),
- _c("polygon", {
- attrs: {
- fill: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 10),
- stroke: _vm.mergedColor[1],
- points:
- "20 " +
- (_vm.height - 10) +
- ", 25 " +
- (_vm.height - 4) +
- ", 55 " +
- (_vm.height - 4) +
- " 60 " +
- (_vm.height - 10)
- }
- }),
- _vm._v(" "),
- _c("polygon", {
- attrs: {
- fill: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 10),
- stroke: _vm.mergedColor[1],
- points:
- _vm.width -
- 20 +
- " 10, " +
- (_vm.width - 25) +
- " 4, " +
- (_vm.width - 55) +
- " 4 " +
- (_vm.width - 60) +
- " 10"
- }
- }),
- _vm._v(" "),
- _c("polygon", {
- attrs: {
- fill: _vm.fade(_vm.mergedColor[1] || _vm.defaultColor[1], 10),
- stroke: _vm.mergedColor[1],
- points:
- _vm.width -
- 20 +
- " " +
- (_vm.height - 10) +
- ", " +
- (_vm.width - 25) +
- " " +
- (_vm.height - 4) +
- ", " +
- (_vm.width - 55) +
- " " +
- (_vm.height - 4) +
- " " +
- (_vm.width - 60) +
- " " +
- (_vm.height - 10)
- }
- }),
- _vm._v(" "),
- _c("polygon", {
- attrs: {
- fill: _vm.fade(_vm.mergedColor[0] || _vm.defaultColor[0], 20),
- stroke: _vm.mergedColor[0],
- points:
- "\n 20 10, 5 " +
- _vm.height / 2 +
- " 20 " +
- (_vm.height - 10) +
- "\n " +
- (_vm.width - 20) +
- " " +
- (_vm.height - 10) +
- " " +
- (_vm.width - 5) +
- " " +
- _vm.height / 2 +
- " " +
- (_vm.width - 20) +
- " 10\n "
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- fill: "transparent",
- stroke: _vm.fade(_vm.mergedColor[0] || _vm.defaultColor[0], 70),
- points: "25 18, 15 " + _vm.height / 2 + " 25 " + (_vm.height - 18)
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- fill: "transparent",
- stroke: _vm.fade(_vm.mergedColor[0] || _vm.defaultColor[0], 70),
- points:
- _vm.width -
- 25 +
- " 18, " +
- (_vm.width - 15) +
- " " +
- _vm.height / 2 +
- " " +
- (_vm.width - 25) +
- " " +
- (_vm.height - 18)
- }
- })
- ]),
- _vm._v(" "),
- _c("div", { staticClass: "decoration-content" }, [_vm._t("default")], 2)
- ])
- };
- var __vue_staticRenderFns__$p = [];
- __vue_render__$p._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$p = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$p = undefined;
- /* module identifier */
- const __vue_module_identifier__$p = undefined;
- /* functional template */
- const __vue_is_functional_template__$p = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$p = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$p, staticRenderFns: __vue_staticRenderFns__$p },
- __vue_inject_styles__$p,
- __vue_script__$p,
- __vue_scope_id__$p,
- __vue_is_functional_template__$p,
- __vue_module_identifier__$p,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function decoration11 (Vue) {
- Vue.component(__vue_component__$p.name, __vue_component__$p);
- }
-
- //
- var script$q = {
- name: 'DvDecoration12',
- mixins: [autoResize],
- props: {
- color: {
- type: Array,
- default: () => []
- },
-
- /**
- * @description Scan animation dur
- */
- scanDur: {
- type: Number,
- default: 3
- },
-
- /**
- * @description Halo animation dur
- */
- haloDur: {
- type: Number,
- default: 2
- }
- },
-
- data() {
- const id = uuid();
- return {
- ref: 'decoration-12',
- gId: `decoration-12-g-${id}`,
- gradientId: `decoration-12-gradient-${id}`,
- defaultColor: ['#2783ce', '#2cf7fe'],
- mergedColor: [],
- pathD: [],
- pathColor: [],
- circleR: [],
- splitLinePoints: [],
- arcD: [],
- segment: 30,
- sectorAngle: Math.PI / 3,
- ringNum: 3,
- ringWidth: 1,
- showSplitLine: true
- };
- },
-
- watch: {
- color() {
- const {
- mergeColor
- } = this;
- mergeColor();
- }
-
- },
- computed: {
- x() {
- const {
- width
- } = this;
- return width / 2;
- },
-
- y() {
- const {
- height
- } = this;
- return height / 2;
- }
-
- },
- methods: {
- init() {
- const {
- mergeColor,
- calcPathD,
- calcPathColor,
- calcCircleR,
- calcSplitLinePoints,
- calcArcD
- } = this;
- mergeColor();
- calcPathD();
- calcPathColor();
- calcCircleR();
- calcSplitLinePoints();
- calcArcD();
- },
-
- mergeColor() {
- const {
- color,
- defaultColor
- } = this;
- this.mergedColor = util_2$1(util_1(defaultColor, true), color || []);
- },
-
- calcPathD() {
- const {
- x,
- y,
- width,
- segment,
- sectorAngle
- } = this;
- const startAngle = -Math.PI / 2;
- const angleGap = sectorAngle / segment;
- const r = width / 4;
- let lastEndPoints = util_13(x, y, r, startAngle);
- this.pathD = new Array(segment).fill('').map((_, i) => {
- const endPoints = util_13(x, y, r, startAngle - (i + 1) * angleGap).map(_ => _.toFixed(5));
- const d = `M${lastEndPoints.join(',')} A${r}, ${r} 0 0 0 ${endPoints.join(',')}`;
- lastEndPoints = endPoints;
- return d;
- });
- },
-
- calcPathColor() {
- const {
- mergedColor: [color],
- segment
- } = this;
- const colorGap = 100 / (segment - 1);
- this.pathColor = new Array(segment).fill(color).map((_, i) => lib_9(color, 100 - i * colorGap));
- },
-
- calcCircleR() {
- const {
- segment,
- ringNum,
- width,
- ringWidth
- } = this;
- const radiusGap = (width / 2 - ringWidth / 2) / ringNum;
- this.circleR = new Array(ringNum).fill(0).map((_, i) => radiusGap * (i + 1));
- },
-
- calcSplitLinePoints() {
- const {
- x,
- y,
- width
- } = this;
- const angleGap = Math.PI / 6;
- const r = width / 2;
- this.splitLinePoints = new Array(6).fill('').map((_, i) => {
- const startAngle = angleGap * (i + 1);
- const endAngle = startAngle + Math.PI;
- const startPoint = util_13(x, y, r, startAngle);
- const endPoint = util_13(x, y, r, endAngle);
- return `${startPoint.join(',')} ${endPoint.join(',')}`;
- });
- },
-
- calcArcD() {
- const {
- x,
- y,
- width
- } = this;
- const angleGap = Math.PI / 6;
- const r = width / 2 - 1;
- this.arcD = new Array(4).fill('').map((_, i) => {
- const startAngle = angleGap * (3 * i + 1);
- const endAngle = startAngle + angleGap;
- const startPoint = util_13(x, y, r, startAngle);
- const endPoint = util_13(x, y, r, endAngle);
- return `M${startPoint.join(',')} A${x}, ${y} 0 0 1 ${endPoint.join(',')}`;
- });
- },
-
- afterAutoResizeMixinInit() {
- const {
- init
- } = this;
- init();
- },
-
- fade: lib_9
- }
- };
-
- /* script */
- const __vue_script__$q = script$q;
-
- /* template */
- var __vue_render__$q = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-decoration-12" }, [
- _c(
- "svg",
- { attrs: { width: _vm.width, height: _vm.height } },
- [
- _c(
- "defs",
- [
- _c(
- "g",
- { attrs: { id: _vm.gId } },
- _vm._l(_vm.pathD, function(d, i) {
- return _c("path", {
- key: d,
- attrs: {
- stroke: _vm.pathColor[i],
- "stroke-width": _vm.width / 2,
- fill: "transparent",
- d: d
- }
- })
- }),
- 0
- ),
- _vm._v(" "),
- _c(
- "radialGradient",
- { attrs: { id: _vm.gradientId, cx: "50%", cy: "50%", r: "50%" } },
- [
- _c("stop", {
- attrs: {
- offset: "0%",
- "stop-color": "transparent",
- "stop-opacity": "1"
- }
- }),
- _vm._v(" "),
- _c("stop", {
- attrs: {
- offset: "100%",
- "stop-color": _vm.fade(
- _vm.mergedColor[1] || _vm.defaultColor[1],
- 30
- ),
- "stop-opacity": "1"
- }
- })
- ],
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _vm._l(_vm.circleR, function(r) {
- return _c("circle", {
- key: r,
- attrs: {
- r: r,
- cx: _vm.x,
- cy: _vm.y,
- stroke: _vm.mergedColor[1],
- "stroke-width": 0.5,
- fill: "transparent"
- }
- })
- }),
- _vm._v(" "),
- _c(
- "circle",
- {
- attrs: {
- r: "1",
- cx: _vm.x,
- cy: _vm.y,
- stroke: "transparent",
- fill: "url(#" + _vm.gradientId + ")"
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "r",
- values: "1;" + _vm.width / 2,
- dur: _vm.haloDur + "s",
- repeatCount: "indefinite"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "opacity",
- values: "1;0",
- dur: _vm.haloDur + "s",
- repeatCount: "indefinite"
- }
- })
- ]
- ),
- _vm._v(" "),
- _c("circle", {
- attrs: { r: "2", cx: _vm.x, cy: _vm.y, fill: _vm.mergedColor[1] }
- }),
- _vm._v(" "),
- _vm.showSplitLine
- ? _c(
- "g",
- _vm._l(_vm.splitLinePoints, function(p) {
- return _c("polyline", {
- key: p,
- attrs: {
- points: p,
- stroke: _vm.mergedColor[1],
- "stroke-width": 0.5,
- opacity: "0.5"
- }
- })
- }),
- 0
- )
- : _vm._e(),
- _vm._v(" "),
- _vm._l(_vm.arcD, function(d) {
- return _c("path", {
- key: d,
- attrs: {
- d: d,
- stroke: _vm.mergedColor[1],
- "stroke-width": "2",
- fill: "transparent"
- }
- })
- }),
- _vm._v(" "),
- _c(
- "use",
- { attrs: { "xlink:href": "#" + _vm.gId } },
- [
- _c("animateTransform", {
- attrs: {
- attributeName: "transform",
- type: "rotate",
- values:
- "0, " + _vm.x + " " + _vm.y + ";360, " + _vm.x + " " + _vm.y,
- dur: _vm.scanDur + "s",
- repeatCount: "indefinite"
- }
- })
- ],
- 1
- )
- ],
- 2
- ),
- _vm._v(" "),
- _c("div", { staticClass: "decoration-content" }, [_vm._t("default")], 2)
- ])
- };
- var __vue_staticRenderFns__$q = [];
- __vue_render__$q._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$q = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$q = undefined;
- /* module identifier */
- const __vue_module_identifier__$q = undefined;
- /* functional template */
- const __vue_is_functional_template__$q = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$q = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$q, staticRenderFns: __vue_staticRenderFns__$q },
- __vue_inject_styles__$q,
- __vue_script__$q,
- __vue_scope_id__$q,
- __vue_is_functional_template__$q,
- __vue_module_identifier__$q,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function decoration12 (Vue) {
- Vue.component(__vue_component__$q.name, __vue_component__$q);
- }
-
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
-
- var classCallCheck = _classCallCheck;
-
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
-
- return obj;
- }
-
- var defineProperty = _defineProperty;
-
- var bezierCurveToPolyline_1 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.bezierCurveToPolyline = bezierCurveToPolyline;
- exports.getBezierCurveLength = getBezierCurveLength;
- exports["default"] = void 0;
-
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
- var sqrt = Math.sqrt,
- pow = Math.pow,
- ceil = Math.ceil,
- abs = Math.abs; // Initialize the number of points per curve
-
- var defaultSegmentPointsNum = 50;
- /**
- * @example data structure of bezierCurve
- * bezierCurve = [
- * // Starting point of the curve
- * [10, 10],
- * // BezierCurve segment data (controlPoint1, controlPoint2, endPoint)
- * [
- * [20, 20], [40, 20], [50, 10]
- * ],
- * ...
- * ]
- */
-
- /**
- * @description Abstract the curve as a polyline consisting of N points
- * @param {Array} bezierCurve bezierCurve data
- * @param {Number} precision calculation accuracy. Recommended for 1-20. Default = 5
- * @return {Object} Calculation results and related data
- * @return {Array} Option.segmentPoints Point data that constitutes a polyline after calculation
- * @return {Number} Option.cycles Number of iterations
- * @return {Number} Option.rounds The number of recursions for the last iteration
- */
-
- function abstractBezierCurveToPolyline(bezierCurve) {
- var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
- var segmentsNum = bezierCurve.length - 1;
- var startPoint = bezierCurve[0];
- var endPoint = bezierCurve[segmentsNum][2];
- var segments = bezierCurve.slice(1);
- var getSegmentTPointFuns = segments.map(function (seg, i) {
- var beginPoint = i === 0 ? startPoint : segments[i - 1][2];
- return createGetBezierCurveTPointFun.apply(void 0, [beginPoint].concat((0, _toConsumableArray2["default"])(seg)));
- }); // Initialize the curve to a polyline
-
- var segmentPointsNum = new Array(segmentsNum).fill(defaultSegmentPointsNum);
- var segmentPoints = getSegmentPointsByNum(getSegmentTPointFuns, segmentPointsNum); // Calculate uniformly distributed points by iteratively
-
- var result = calcUniformPointsByIteration(segmentPoints, getSegmentTPointFuns, segments, precision);
- result.segmentPoints.push(endPoint);
- return result;
- }
- /**
- * @description Generate a method for obtaining corresponding point by t according to curve data
- * @param {Array} beginPoint BezierCurve begin point. [x, y]
- * @param {Array} controlPoint1 BezierCurve controlPoint1. [x, y]
- * @param {Array} controlPoint2 BezierCurve controlPoint2. [x, y]
- * @param {Array} endPoint BezierCurve end point. [x, y]
- * @return {Function} Expected function
- */
-
-
- function createGetBezierCurveTPointFun(beginPoint, controlPoint1, controlPoint2, endPoint) {
- return function (t) {
- var tSubed1 = 1 - t;
- var tSubed1Pow3 = pow(tSubed1, 3);
- var tSubed1Pow2 = pow(tSubed1, 2);
- var tPow3 = pow(t, 3);
- var tPow2 = pow(t, 2);
- 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];
- };
- }
- /**
- * @description Get the distance between two points
- * @param {Array} point1 BezierCurve begin point. [x, y]
- * @param {Array} point2 BezierCurve controlPoint1. [x, y]
- * @return {Number} Expected distance
- */
-
-
- function getTwoPointDistance(_ref, _ref2) {
- var _ref3 = (0, _slicedToArray2["default"])(_ref, 2),
- ax = _ref3[0],
- ay = _ref3[1];
-
- var _ref4 = (0, _slicedToArray2["default"])(_ref2, 2),
- bx = _ref4[0],
- by = _ref4[1];
-
- return sqrt(pow(ax - bx, 2) + pow(ay - by, 2));
- }
- /**
- * @description Get the sum of the array of numbers
- * @param {Array} nums An array of numbers
- * @return {Number} Expected sum
- */
-
-
- function getNumsSum(nums) {
- return nums.reduce(function (sum, num) {
- return sum + num;
- }, 0);
- }
- /**
- * @description Get the distance of multiple sets of points
- * @param {Array} segmentPoints Multiple sets of point data
- * @return {Array} Distance of multiple sets of point data
- */
-
-
- function getSegmentPointsDistance(segmentPoints) {
- return segmentPoints.map(function (points, i) {
- return new Array(points.length - 1).fill(0).map(function (temp, j) {
- return getTwoPointDistance(points[j], points[j + 1]);
- });
- });
- }
- /**
- * @description Get the distance of multiple sets of points
- * @param {Array} segmentPoints Multiple sets of point data
- * @return {Array} Distance of multiple sets of point data
- */
-
-
- function getSegmentPointsByNum(getSegmentTPointFuns, segmentPointsNum) {
- return getSegmentTPointFuns.map(function (getSegmentTPointFun, i) {
- var tGap = 1 / segmentPointsNum[i];
- return new Array(segmentPointsNum[i]).fill('').map(function (foo, j) {
- return getSegmentTPointFun(j * tGap);
- });
- });
- }
- /**
- * @description Get the sum of deviations between line segment and the average length
- * @param {Array} segmentPointsDistance Segment length of polyline
- * @param {Number} avgLength Average length of the line segment
- * @return {Number} Deviations
- */
-
-
- function getAllDeviations(segmentPointsDistance, avgLength) {
- return segmentPointsDistance.map(function (seg) {
- return seg.map(function (s) {
- return abs(s - avgLength);
- });
- }).map(function (seg) {
- return getNumsSum(seg);
- }).reduce(function (total, v) {
- return total + v;
- }, 0);
- }
- /**
- * @description Calculate uniformly distributed points by iteratively
- * @param {Array} segmentPoints Multiple setd of points that make up a polyline
- * @param {Array} getSegmentTPointFuns Functions of get a point on the curve with t
- * @param {Array} segments BezierCurve data
- * @param {Number} precision Calculation accuracy
- * @return {Object} Calculation results and related data
- * @return {Array} Option.segmentPoints Point data that constitutes a polyline after calculation
- * @return {Number} Option.cycles Number of iterations
- * @return {Number} Option.rounds The number of recursions for the last iteration
- */
-
-
- function calcUniformPointsByIteration(segmentPoints, getSegmentTPointFuns, segments, precision) {
- // The number of loops for the current iteration
- var rounds = 4; // Number of iterations
-
- var cycles = 1;
-
- var _loop = function _loop() {
- // Recalculate the number of points per curve based on the last iteration data
- var totalPointsNum = segmentPoints.reduce(function (total, seg) {
- return total + seg.length;
- }, 0); // Add last points of segment to calc exact segment length
-
- segmentPoints.forEach(function (seg, i) {
- return seg.push(segments[i][2]);
- });
- var segmentPointsDistance = getSegmentPointsDistance(segmentPoints);
- var lineSegmentNum = segmentPointsDistance.reduce(function (total, seg) {
- return total + seg.length;
- }, 0);
- var segmentlength = segmentPointsDistance.map(function (seg) {
- return getNumsSum(seg);
- });
- var totalLength = getNumsSum(segmentlength);
- var avgLength = totalLength / lineSegmentNum; // Check if precision is reached
-
- var allDeviations = getAllDeviations(segmentPointsDistance, avgLength);
- if (allDeviations <= precision) return "break";
- totalPointsNum = ceil(avgLength / precision * totalPointsNum * 1.1);
- var segmentPointsNum = segmentlength.map(function (length) {
- return ceil(length / totalLength * totalPointsNum);
- }); // Calculate the points after redistribution
-
- segmentPoints = getSegmentPointsByNum(getSegmentTPointFuns, segmentPointsNum);
- totalPointsNum = segmentPoints.reduce(function (total, seg) {
- return total + seg.length;
- }, 0);
- var segmentPointsForLength = JSON.parse(JSON.stringify(segmentPoints));
- segmentPointsForLength.forEach(function (seg, i) {
- return seg.push(segments[i][2]);
- });
- segmentPointsDistance = getSegmentPointsDistance(segmentPointsForLength);
- lineSegmentNum = segmentPointsDistance.reduce(function (total, seg) {
- return total + seg.length;
- }, 0);
- segmentlength = segmentPointsDistance.map(function (seg) {
- return getNumsSum(seg);
- });
- totalLength = getNumsSum(segmentlength);
- avgLength = totalLength / lineSegmentNum;
- var stepSize = 1 / totalPointsNum / 10; // Recursively for each segment of the polyline
-
- getSegmentTPointFuns.forEach(function (getSegmentTPointFun, i) {
- var currentSegmentPointsNum = segmentPointsNum[i];
- var t = new Array(currentSegmentPointsNum).fill('').map(function (foo, j) {
- return j / segmentPointsNum[i];
- }); // Repeated recursive offset
-
- for (var r = 0; r < rounds; r++) {
- var distance = getSegmentPointsDistance([segmentPoints[i]])[0];
- var deviations = distance.map(function (d) {
- return d - avgLength;
- });
- var offset = 0;
-
- for (var j = 0; j < currentSegmentPointsNum; j++) {
- if (j === 0) return;
- offset += deviations[j - 1];
- t[j] -= stepSize * offset;
- if (t[j] > 1) t[j] = 1;
- if (t[j] < 0) t[j] = 0;
- segmentPoints[i][j] = getSegmentTPointFun(t[j]);
- }
- }
- });
- rounds *= 4;
- cycles++;
- };
-
- do {
- var _ret = _loop();
-
- if (_ret === "break") break;
- } while (rounds <= 1025);
-
- segmentPoints = segmentPoints.reduce(function (all, seg) {
- return all.concat(seg);
- }, []);
- return {
- segmentPoints: segmentPoints,
- cycles: cycles,
- rounds: rounds
- };
- }
- /**
- * @description Get the polyline corresponding to the Bezier curve
- * @param {Array} bezierCurve BezierCurve data
- * @param {Number} precision Calculation accuracy. Recommended for 1-20. Default = 5
- * @return {Array|Boolean} Point data that constitutes a polyline after calculation (Invalid input will return false)
- */
-
-
- function bezierCurveToPolyline(bezierCurve) {
- var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
-
- if (!bezierCurve) {
- console.error('bezierCurveToPolyline: Missing parameters!');
- return false;
- }
-
- if (!(bezierCurve instanceof Array)) {
- console.error('bezierCurveToPolyline: Parameter bezierCurve must be an array!');
- return false;
- }
-
- if (typeof precision !== 'number') {
- console.error('bezierCurveToPolyline: Parameter precision must be a number!');
- return false;
- }
-
- var _abstractBezierCurveT = abstractBezierCurveToPolyline(bezierCurve, precision),
- segmentPoints = _abstractBezierCurveT.segmentPoints;
-
- return segmentPoints;
- }
- /**
- * @description Get the bezier curve length
- * @param {Array} bezierCurve bezierCurve data
- * @param {Number} precision calculation accuracy. Recommended for 5-10. Default = 5
- * @return {Number|Boolean} BezierCurve length (Invalid input will return false)
- */
-
-
- function getBezierCurveLength(bezierCurve) {
- var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
-
- if (!bezierCurve) {
- console.error('getBezierCurveLength: Missing parameters!');
- return false;
- }
-
- if (!(bezierCurve instanceof Array)) {
- console.error('getBezierCurveLength: Parameter bezierCurve must be an array!');
- return false;
- }
-
- if (typeof precision !== 'number') {
- console.error('getBezierCurveLength: Parameter precision must be a number!');
- return false;
- }
-
- var _abstractBezierCurveT2 = abstractBezierCurveToPolyline(bezierCurve, precision),
- segmentPoints = _abstractBezierCurveT2.segmentPoints; // Calculate the total length of the points that make up the polyline
-
-
- var pointsDistance = getSegmentPointsDistance([segmentPoints])[0];
- var length = getNumsSum(pointsDistance);
- return length;
- }
-
- var _default = bezierCurveToPolyline;
- exports["default"] = _default;
- });
-
- unwrapExports(bezierCurveToPolyline_1);
- var bezierCurveToPolyline_2 = bezierCurveToPolyline_1.bezierCurveToPolyline;
- var bezierCurveToPolyline_3 = bezierCurveToPolyline_1.getBezierCurveLength;
-
- var polylineToBezierCurve_1 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
-
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
- /**
- * @description Abstract the polyline formed by N points into a set of bezier curve
- * @param {Array} polyline A set of points that make up a polyline
- * @param {Boolean} close Closed curve
- * @param {Number} offsetA Smoothness
- * @param {Number} offsetB Smoothness
- * @return {Array|Boolean} A set of bezier curve (Invalid input will return false)
- */
- function polylineToBezierCurve(polyline) {
- var close = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var offsetA = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.25;
- var offsetB = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.25;
-
- if (!(polyline instanceof Array)) {
- console.error('polylineToBezierCurve: Parameter polyline must be an array!');
- return false;
- }
-
- if (polyline.length <= 2) {
- console.error('polylineToBezierCurve: Converting to a curve requires at least 3 points!');
- return false;
- }
-
- var startPoint = polyline[0];
- var bezierCurveLineNum = polyline.length - 1;
- var bezierCurvePoints = new Array(bezierCurveLineNum).fill(0).map(function (foo, i) {
- return [].concat((0, _toConsumableArray2["default"])(getBezierCurveLineControlPoints(polyline, i, close, offsetA, offsetB)), [polyline[i + 1]]);
- });
- if (close) closeBezierCurve(bezierCurvePoints, startPoint);
- bezierCurvePoints.unshift(polyline[0]);
- return bezierCurvePoints;
- }
- /**
- * @description Get the control points of the Bezier curve
- * @param {Array} polyline A set of points that make up a polyline
- * @param {Number} index The index of which get controls points's point in polyline
- * @param {Boolean} close Closed curve
- * @param {Number} offsetA Smoothness
- * @param {Number} offsetB Smoothness
- * @return {Array} Control points
- */
-
-
- function getBezierCurveLineControlPoints(polyline, index) {
- var close = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var offsetA = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.25;
- var offsetB = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0.25;
- var pointNum = polyline.length;
- if (pointNum < 3 || index >= pointNum) return;
- var beforePointIndex = index - 1;
- if (beforePointIndex < 0) beforePointIndex = close ? pointNum + beforePointIndex : 0;
- var afterPointIndex = index + 1;
- if (afterPointIndex >= pointNum) afterPointIndex = close ? afterPointIndex - pointNum : pointNum - 1;
- var afterNextPointIndex = index + 2;
- if (afterNextPointIndex >= pointNum) afterNextPointIndex = close ? afterNextPointIndex - pointNum : pointNum - 1;
- var pointBefore = polyline[beforePointIndex];
- var pointMiddle = polyline[index];
- var pointAfter = polyline[afterPointIndex];
- var pointAfterNext = polyline[afterNextPointIndex];
- 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])]];
- }
- /**
- * @description Get the last curve of the closure
- * @param {Array} bezierCurve A set of sub-curve
- * @param {Array} startPoint Start point
- * @return {Array} The last curve for closure
- */
-
-
- function closeBezierCurve(bezierCurve, startPoint) {
- var firstSubCurve = bezierCurve[0];
- var lastSubCurve = bezierCurve.slice(-1)[0];
- bezierCurve.push([getSymmetryPoint(lastSubCurve[1], lastSubCurve[2]), getSymmetryPoint(firstSubCurve[0], startPoint), startPoint]);
- return bezierCurve;
- }
- /**
- * @description Get the symmetry point
- * @param {Array} point Symmetric point
- * @param {Array} centerPoint Symmetric center
- * @return {Array} Symmetric point
- */
-
-
- function getSymmetryPoint(point, centerPoint) {
- var _point = (0, _slicedToArray2["default"])(point, 2),
- px = _point[0],
- py = _point[1];
-
- var _centerPoint = (0, _slicedToArray2["default"])(centerPoint, 2),
- cx = _centerPoint[0],
- cy = _centerPoint[1];
-
- var minusX = cx - px;
- var minusY = cy - py;
- return [cx + minusX, cy + minusY];
- }
-
- var _default = polylineToBezierCurve;
- exports["default"] = _default;
- });
-
- unwrapExports(polylineToBezierCurve_1);
-
- var lib$1 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- Object.defineProperty(exports, "bezierCurveToPolyline", {
- enumerable: true,
- get: function get() {
- return bezierCurveToPolyline_1.bezierCurveToPolyline;
- }
- });
- Object.defineProperty(exports, "getBezierCurveLength", {
- enumerable: true,
- get: function get() {
- return bezierCurveToPolyline_1.getBezierCurveLength;
- }
- });
- Object.defineProperty(exports, "polylineToBezierCurve", {
- enumerable: true,
- get: function get() {
- return _polylineToBezierCurve["default"];
- }
- });
- exports["default"] = void 0;
-
-
-
- var _polylineToBezierCurve = interopRequireDefault(polylineToBezierCurve_1);
-
- var _default = {
- bezierCurveToPolyline: bezierCurveToPolyline_1.bezierCurveToPolyline,
- getBezierCurveLength: bezierCurveToPolyline_1.getBezierCurveLength,
- polylineToBezierCurve: _polylineToBezierCurve["default"]
- };
- exports["default"] = _default;
- });
-
- unwrapExports(lib$1);
-
- var canvas = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.drawPolylinePath = drawPolylinePath;
- exports.drawBezierCurvePath = drawBezierCurvePath;
- exports["default"] = void 0;
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
- /**
- * @description Draw a polyline path
- * @param {Object} ctx Canvas 2d context
- * @param {Array} points The points that makes up a polyline
- * @param {Boolean} beginPath Whether to execute beginPath
- * @param {Boolean} closePath Whether to execute closePath
- * @return {Undefined} Void
- */
- function drawPolylinePath(ctx, points) {
- var beginPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var closePath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
- if (!ctx || points.length < 2) return false;
- if (beginPath) ctx.beginPath();
- points.forEach(function (point, i) {
- return point && (i === 0 ? ctx.moveTo.apply(ctx, (0, _toConsumableArray2["default"])(point)) : ctx.lineTo.apply(ctx, (0, _toConsumableArray2["default"])(point)));
- });
- if (closePath) ctx.closePath();
- }
- /**
- * @description Draw a bezier curve path
- * @param {Object} ctx Canvas 2d context
- * @param {Array} points The points that makes up a bezier curve
- * @param {Array} moveTo The point need to excute moveTo
- * @param {Boolean} beginPath Whether to execute beginPath
- * @param {Boolean} closePath Whether to execute closePath
- * @return {Undefined} Void
- */
-
-
- function drawBezierCurvePath(ctx, points) {
- var moveTo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var beginPath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
- var closePath = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
- if (!ctx || !points) return false;
- if (beginPath) ctx.beginPath();
- if (moveTo) ctx.moveTo.apply(ctx, (0, _toConsumableArray2["default"])(moveTo));
- points.forEach(function (item) {
- return item && ctx.bezierCurveTo.apply(ctx, (0, _toConsumableArray2["default"])(item[0]).concat((0, _toConsumableArray2["default"])(item[1]), (0, _toConsumableArray2["default"])(item[2])));
- });
- if (closePath) ctx.closePath();
- }
-
- var _default = {
- drawPolylinePath: drawPolylinePath,
- drawBezierCurvePath: drawBezierCurvePath
- };
- exports["default"] = _default;
- });
-
- unwrapExports(canvas);
- var canvas_1 = canvas.drawPolylinePath;
- var canvas_2 = canvas.drawBezierCurvePath;
-
- var graphs_1 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.extendNewGraph = extendNewGraph;
- 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;
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
-
- var _bezierCurve2 = interopRequireDefault(lib$1);
-
-
-
-
-
- var polylineToBezierCurve = _bezierCurve2["default"].polylineToBezierCurve,
- bezierCurveToPolyline = _bezierCurve2["default"].bezierCurveToPolyline;
- var circle = {
- shape: {
- rx: 0,
- ry: 0,
- r: 0
- },
- validator: function validator(_ref) {
- var shape = _ref.shape;
- var rx = shape.rx,
- ry = shape.ry,
- r = shape.r;
-
- if (typeof rx !== 'number' || typeof ry !== 'number' || typeof r !== 'number') {
- console.error('Circle shape configuration is abnormal!');
- return false;
- }
-
- return true;
- },
- draw: function draw(_ref2, _ref3) {
- var ctx = _ref2.ctx;
- var shape = _ref3.shape;
- ctx.beginPath();
- var rx = shape.rx,
- ry = shape.ry,
- r = shape.r;
- ctx.arc(rx, ry, r > 0 ? r : 0.01, 0, Math.PI * 2);
- ctx.fill();
- ctx.stroke();
- ctx.closePath();
- },
- hoverCheck: function hoverCheck(position, _ref4) {
- var shape = _ref4.shape;
- var rx = shape.rx,
- ry = shape.ry,
- r = shape.r;
- return (0, util.checkPointIsInCircle)(position, rx, ry, r);
- },
- setGraphCenter: function setGraphCenter(e, _ref5) {
- var shape = _ref5.shape,
- style = _ref5.style;
- var rx = shape.rx,
- ry = shape.ry;
- style.graphCenter = [rx, ry];
- },
- move: function move(_ref6, _ref7) {
- var movementX = _ref6.movementX,
- movementY = _ref6.movementY;
- var shape = _ref7.shape;
- this.attr('shape', {
- rx: shape.rx + movementX,
- ry: shape.ry + movementY
- });
- }
- };
- exports.circle = circle;
- var ellipse = {
- shape: {
- rx: 0,
- ry: 0,
- hr: 0,
- vr: 0
- },
- validator: function validator(_ref8) {
- var shape = _ref8.shape;
- var rx = shape.rx,
- ry = shape.ry,
- hr = shape.hr,
- vr = shape.vr;
-
- if (typeof rx !== 'number' || typeof ry !== 'number' || typeof hr !== 'number' || typeof vr !== 'number') {
- console.error('Ellipse shape configuration is abnormal!');
- return false;
- }
-
- return true;
- },
- draw: function draw(_ref9, _ref10) {
- var ctx = _ref9.ctx;
- var shape = _ref10.shape;
- ctx.beginPath();
- var rx = shape.rx,
- ry = shape.ry,
- hr = shape.hr,
- vr = shape.vr;
- ctx.ellipse(rx, ry, hr > 0 ? hr : 0.01, vr > 0 ? vr : 0.01, 0, 0, Math.PI * 2);
- ctx.fill();
- ctx.stroke();
- ctx.closePath();
- },
- hoverCheck: function hoverCheck(position, _ref11) {
- var shape = _ref11.shape;
- var rx = shape.rx,
- ry = shape.ry,
- hr = shape.hr,
- vr = shape.vr;
- var a = Math.max(hr, vr);
- var b = Math.min(hr, vr);
- var c = Math.sqrt(a * a - b * b);
- var leftFocusPoint = [rx - c, ry];
- var rightFocusPoint = [rx + c, ry];
- var distance = (0, util.getTwoPointDistance)(position, leftFocusPoint) + (0, util.getTwoPointDistance)(position, rightFocusPoint);
- return distance <= 2 * a;
- },
- setGraphCenter: function setGraphCenter(e, _ref12) {
- var shape = _ref12.shape,
- style = _ref12.style;
- var rx = shape.rx,
- ry = shape.ry;
- style.graphCenter = [rx, ry];
- },
- move: function move(_ref13, _ref14) {
- var movementX = _ref13.movementX,
- movementY = _ref13.movementY;
- var shape = _ref14.shape;
- this.attr('shape', {
- rx: shape.rx + movementX,
- ry: shape.ry + movementY
- });
- }
- };
- exports.ellipse = ellipse;
- var rect = {
- shape: {
- x: 0,
- y: 0,
- w: 0,
- h: 0
- },
- validator: function validator(_ref15) {
- var shape = _ref15.shape;
- var x = shape.x,
- y = shape.y,
- w = shape.w,
- h = shape.h;
-
- if (typeof x !== 'number' || typeof y !== 'number' || typeof w !== 'number' || typeof h !== 'number') {
- console.error('Rect shape configuration is abnormal!');
- return false;
- }
-
- return true;
- },
- draw: function draw(_ref16, _ref17) {
- var ctx = _ref16.ctx;
- var shape = _ref17.shape;
- ctx.beginPath();
- var x = shape.x,
- y = shape.y,
- w = shape.w,
- h = shape.h;
- ctx.rect(x, y, w, h);
- ctx.fill();
- ctx.stroke();
- ctx.closePath();
- },
- hoverCheck: function hoverCheck(position, _ref18) {
- var shape = _ref18.shape;
- var x = shape.x,
- y = shape.y,
- w = shape.w,
- h = shape.h;
- return (0, util.checkPointIsInRect)(position, x, y, w, h);
- },
- setGraphCenter: function setGraphCenter(e, _ref19) {
- var shape = _ref19.shape,
- style = _ref19.style;
- var x = shape.x,
- y = shape.y,
- w = shape.w,
- h = shape.h;
- style.graphCenter = [x + w / 2, y + h / 2];
- },
- move: function move(_ref20, _ref21) {
- var movementX = _ref20.movementX,
- movementY = _ref20.movementY;
- var shape = _ref21.shape;
- this.attr('shape', {
- x: shape.x + movementX,
- y: shape.y + movementY
- });
- }
- };
- exports.rect = rect;
- var ring = {
- shape: {
- rx: 0,
- ry: 0,
- r: 0
- },
- validator: function validator(_ref22) {
- var shape = _ref22.shape;
- var rx = shape.rx,
- ry = shape.ry,
- r = shape.r;
-
- if (typeof rx !== 'number' || typeof ry !== 'number' || typeof r !== 'number') {
- console.error('Ring shape configuration is abnormal!');
- return false;
- }
-
- return true;
- },
- draw: function draw(_ref23, _ref24) {
- var ctx = _ref23.ctx;
- var shape = _ref24.shape;
- ctx.beginPath();
- var rx = shape.rx,
- ry = shape.ry,
- r = shape.r;
- ctx.arc(rx, ry, r > 0 ? r : 0.01, 0, Math.PI * 2);
- ctx.stroke();
- ctx.closePath();
- },
- hoverCheck: function hoverCheck(position, _ref25) {
- var shape = _ref25.shape,
- style = _ref25.style;
- var rx = shape.rx,
- ry = shape.ry,
- r = shape.r;
- var lineWidth = style.lineWidth;
- var halfLineWidth = lineWidth / 2;
- var minDistance = r - halfLineWidth;
- var maxDistance = r + halfLineWidth;
- var distance = (0, util.getTwoPointDistance)(position, [rx, ry]);
- return distance >= minDistance && distance <= maxDistance;
- },
- setGraphCenter: function setGraphCenter(e, _ref26) {
- var shape = _ref26.shape,
- style = _ref26.style;
- var rx = shape.rx,
- ry = shape.ry;
- style.graphCenter = [rx, ry];
- },
- move: function move(_ref27, _ref28) {
- var movementX = _ref27.movementX,
- movementY = _ref27.movementY;
- var shape = _ref28.shape;
- this.attr('shape', {
- rx: shape.rx + movementX,
- ry: shape.ry + movementY
- });
- }
- };
- exports.ring = ring;
- var arc = {
- shape: {
- rx: 0,
- ry: 0,
- r: 0,
- startAngle: 0,
- endAngle: 0,
- clockWise: true
- },
- validator: function validator(_ref29) {
- var shape = _ref29.shape;
- var keys = ['rx', 'ry', 'r', 'startAngle', 'endAngle'];
-
- if (keys.find(function (key) {
- return typeof shape[key] !== 'number';
- })) {
- console.error('Arc shape configuration is abnormal!');
- return false;
- }
-
- return true;
- },
- draw: function draw(_ref30, _ref31) {
- var ctx = _ref30.ctx;
- var shape = _ref31.shape;
- ctx.beginPath();
- var rx = shape.rx,
- ry = shape.ry,
- r = shape.r,
- startAngle = shape.startAngle,
- endAngle = shape.endAngle,
- clockWise = shape.clockWise;
- ctx.arc(rx, ry, r > 0 ? r : 0.001, startAngle, endAngle, !clockWise);
- ctx.stroke();
- ctx.closePath();
- },
- hoverCheck: function hoverCheck(position, _ref32) {
- var shape = _ref32.shape,
- style = _ref32.style;
- var rx = shape.rx,
- ry = shape.ry,
- r = shape.r,
- startAngle = shape.startAngle,
- endAngle = shape.endAngle,
- clockWise = shape.clockWise;
- var lineWidth = style.lineWidth;
- var halfLineWidth = lineWidth / 2;
- var insideRadius = r - halfLineWidth;
- var outsideRadius = r + halfLineWidth;
- return !(0, util.checkPointIsInSector)(position, rx, ry, insideRadius, startAngle, endAngle, clockWise) && (0, util.checkPointIsInSector)(position, rx, ry, outsideRadius, startAngle, endAngle, clockWise);
- },
- setGraphCenter: function setGraphCenter(e, _ref33) {
- var shape = _ref33.shape,
- style = _ref33.style;
- var rx = shape.rx,
- ry = shape.ry;
- style.graphCenter = [rx, ry];
- },
- move: function move(_ref34, _ref35) {
- var movementX = _ref34.movementX,
- movementY = _ref34.movementY;
- var shape = _ref35.shape;
- this.attr('shape', {
- rx: shape.rx + movementX,
- ry: shape.ry + movementY
- });
- }
- };
- exports.arc = arc;
- var sector = {
- shape: {
- rx: 0,
- ry: 0,
- r: 0,
- startAngle: 0,
- endAngle: 0,
- clockWise: true
- },
- validator: function validator(_ref36) {
- var shape = _ref36.shape;
- var keys = ['rx', 'ry', 'r', 'startAngle', 'endAngle'];
-
- if (keys.find(function (key) {
- return typeof shape[key] !== 'number';
- })) {
- console.error('Sector shape configuration is abnormal!');
- return false;
- }
-
- return true;
- },
- draw: function draw(_ref37, _ref38) {
- var ctx = _ref37.ctx;
- var shape = _ref38.shape;
- ctx.beginPath();
- var rx = shape.rx,
- ry = shape.ry,
- r = shape.r,
- startAngle = shape.startAngle,
- endAngle = shape.endAngle,
- clockWise = shape.clockWise;
- ctx.arc(rx, ry, r > 0 ? r : 0.01, startAngle, endAngle, !clockWise);
- ctx.lineTo(rx, ry);
- ctx.closePath();
- ctx.stroke();
- ctx.fill();
- },
- hoverCheck: function hoverCheck(position, _ref39) {
- var shape = _ref39.shape;
- var rx = shape.rx,
- ry = shape.ry,
- r = shape.r,
- startAngle = shape.startAngle,
- endAngle = shape.endAngle,
- clockWise = shape.clockWise;
- return (0, util.checkPointIsInSector)(position, rx, ry, r, startAngle, endAngle, clockWise);
- },
- setGraphCenter: function setGraphCenter(e, _ref40) {
- var shape = _ref40.shape,
- style = _ref40.style;
- var rx = shape.rx,
- ry = shape.ry;
- style.graphCenter = [rx, ry];
- },
- move: function move(_ref41, _ref42) {
- var movementX = _ref41.movementX,
- movementY = _ref41.movementY;
- var shape = _ref42.shape;
- var rx = shape.rx,
- ry = shape.ry;
- this.attr('shape', {
- rx: rx + movementX,
- ry: ry + movementY
- });
- }
- };
- exports.sector = sector;
- var regPolygon = {
- shape: {
- rx: 0,
- ry: 0,
- r: 0,
- side: 0
- },
- validator: function validator(_ref43) {
- var shape = _ref43.shape;
- var side = shape.side;
- var keys = ['rx', 'ry', 'r', 'side'];
-
- if (keys.find(function (key) {
- return typeof shape[key] !== 'number';
- })) {
- console.error('RegPolygon shape configuration is abnormal!');
- return false;
- }
-
- if (side < 3) {
- console.error('RegPolygon at least trigon!');
- return false;
- }
-
- return true;
- },
- draw: function draw(_ref44, _ref45) {
- var ctx = _ref44.ctx;
- var shape = _ref45.shape,
- cache = _ref45.cache;
- ctx.beginPath();
- var rx = shape.rx,
- ry = shape.ry,
- r = shape.r,
- side = shape.side;
-
- if (!cache.points || cache.rx !== rx || cache.ry !== ry || cache.r !== r || cache.side !== side) {
- var _points = (0, util.getRegularPolygonPoints)(rx, ry, r, side);
-
- Object.assign(cache, {
- points: _points,
- rx: rx,
- ry: ry,
- r: r,
- side: side
- });
- }
-
- var points = cache.points;
- (0, canvas.drawPolylinePath)(ctx, points);
- ctx.closePath();
- ctx.stroke();
- ctx.fill();
- },
- hoverCheck: function hoverCheck(position, _ref46) {
- var cache = _ref46.cache;
- var points = cache.points;
- return (0, util.checkPointIsInPolygon)(position, points);
- },
- setGraphCenter: function setGraphCenter(e, _ref47) {
- var shape = _ref47.shape,
- style = _ref47.style;
- var rx = shape.rx,
- ry = shape.ry;
- style.graphCenter = [rx, ry];
- },
- move: function move(_ref48, _ref49) {
- var movementX = _ref48.movementX,
- movementY = _ref48.movementY;
- var shape = _ref49.shape,
- cache = _ref49.cache;
- var rx = shape.rx,
- ry = shape.ry;
- cache.rx += movementX;
- cache.ry += movementY;
- this.attr('shape', {
- rx: rx + movementX,
- ry: ry + movementY
- });
- cache.points = cache.points.map(function (_ref50) {
- var _ref51 = (0, _slicedToArray2["default"])(_ref50, 2),
- x = _ref51[0],
- y = _ref51[1];
-
- return [x + movementX, y + movementY];
- });
- }
- };
- exports.regPolygon = regPolygon;
- var polyline = {
- shape: {
- points: [],
- close: false
- },
- validator: function validator(_ref52) {
- var shape = _ref52.shape;
- var points = shape.points;
-
- if (!(points instanceof Array)) {
- console.error('Polyline points should be an array!');
- return false;
- }
-
- return true;
- },
- draw: function draw(_ref53, _ref54) {
- var ctx = _ref53.ctx;
- var shape = _ref54.shape,
- lineWidth = _ref54.style.lineWidth;
- ctx.beginPath();
- var points = shape.points,
- close = shape.close;
- if (lineWidth === 1) points = (0, util.eliminateBlur)(points);
- (0, canvas.drawPolylinePath)(ctx, points);
-
- if (close) {
- ctx.closePath();
- ctx.fill();
- ctx.stroke();
- } else {
- ctx.stroke();
- }
- },
- hoverCheck: function hoverCheck(position, _ref55) {
- var shape = _ref55.shape,
- style = _ref55.style;
- var points = shape.points,
- close = shape.close;
- var lineWidth = style.lineWidth;
-
- if (close) {
- return (0, util.checkPointIsInPolygon)(position, points);
- } else {
- return (0, util.checkPointIsNearPolyline)(position, points, lineWidth);
- }
- },
- setGraphCenter: function setGraphCenter(e, _ref56) {
- var shape = _ref56.shape,
- style = _ref56.style;
- var points = shape.points;
- style.graphCenter = points[0];
- },
- move: function move(_ref57, _ref58) {
- var movementX = _ref57.movementX,
- movementY = _ref57.movementY;
- var shape = _ref58.shape;
- var points = shape.points;
- var moveAfterPoints = points.map(function (_ref59) {
- var _ref60 = (0, _slicedToArray2["default"])(_ref59, 2),
- x = _ref60[0],
- y = _ref60[1];
-
- return [x + movementX, y + movementY];
- });
- this.attr('shape', {
- points: moveAfterPoints
- });
- }
- };
- exports.polyline = polyline;
- var smoothline = {
- shape: {
- points: [],
- close: false
- },
- validator: function validator(_ref61) {
- var shape = _ref61.shape;
- var points = shape.points;
-
- if (!(points instanceof Array)) {
- console.error('Smoothline points should be an array!');
- return false;
- }
-
- return true;
- },
- draw: function draw(_ref62, _ref63) {
- var ctx = _ref62.ctx;
- var shape = _ref63.shape,
- cache = _ref63.cache;
- var points = shape.points,
- close = shape.close;
-
- if (!cache.points || cache.points.toString() !== points.toString()) {
- var _bezierCurve = polylineToBezierCurve(points, close);
-
- var hoverPoints = bezierCurveToPolyline(_bezierCurve);
- Object.assign(cache, {
- points: (0, util.deepClone)(points, true),
- bezierCurve: _bezierCurve,
- hoverPoints: hoverPoints
- });
- }
-
- var bezierCurve = cache.bezierCurve;
- ctx.beginPath();
- (0, canvas.drawBezierCurvePath)(ctx, bezierCurve.slice(1), bezierCurve[0]);
-
- if (close) {
- ctx.closePath();
- ctx.fill();
- ctx.stroke();
- } else {
- ctx.stroke();
- }
- },
- hoverCheck: function hoverCheck(position, _ref64) {
- var cache = _ref64.cache,
- shape = _ref64.shape,
- style = _ref64.style;
- var hoverPoints = cache.hoverPoints;
- var close = shape.close;
- var lineWidth = style.lineWidth;
-
- if (close) {
- return (0, util.checkPointIsInPolygon)(position, hoverPoints);
- } else {
- return (0, util.checkPointIsNearPolyline)(position, hoverPoints, lineWidth);
- }
- },
- setGraphCenter: function setGraphCenter(e, _ref65) {
- var shape = _ref65.shape,
- style = _ref65.style;
- var points = shape.points;
- style.graphCenter = points[0];
- },
- move: function move(_ref66, _ref67) {
- var movementX = _ref66.movementX,
- movementY = _ref66.movementY;
- var shape = _ref67.shape,
- cache = _ref67.cache;
- var points = shape.points;
- var moveAfterPoints = points.map(function (_ref68) {
- var _ref69 = (0, _slicedToArray2["default"])(_ref68, 2),
- x = _ref69[0],
- y = _ref69[1];
-
- return [x + movementX, y + movementY];
- });
- cache.points = moveAfterPoints;
-
- var _cache$bezierCurve$ = (0, _slicedToArray2["default"])(cache.bezierCurve[0], 2),
- fx = _cache$bezierCurve$[0],
- fy = _cache$bezierCurve$[1];
-
- var curves = cache.bezierCurve.slice(1);
- cache.bezierCurve = [[fx + movementX, fy + movementY]].concat((0, _toConsumableArray2["default"])(curves.map(function (curve) {
- return curve.map(function (_ref70) {
- var _ref71 = (0, _slicedToArray2["default"])(_ref70, 2),
- x = _ref71[0],
- y = _ref71[1];
-
- return [x + movementX, y + movementY];
- });
- })));
- cache.hoverPoints = cache.hoverPoints.map(function (_ref72) {
- var _ref73 = (0, _slicedToArray2["default"])(_ref72, 2),
- x = _ref73[0],
- y = _ref73[1];
-
- return [x + movementX, y + movementY];
- });
- this.attr('shape', {
- points: moveAfterPoints
- });
- }
- };
- exports.smoothline = smoothline;
- var bezierCurve = {
- shape: {
- points: [],
- close: false
- },
- validator: function validator(_ref74) {
- var shape = _ref74.shape;
- var points = shape.points;
-
- if (!(points instanceof Array)) {
- console.error('BezierCurve points should be an array!');
- return false;
- }
-
- return true;
- },
- draw: function draw(_ref75, _ref76) {
- var ctx = _ref75.ctx;
- var shape = _ref76.shape,
- cache = _ref76.cache;
- var points = shape.points,
- close = shape.close;
-
- if (!cache.points || cache.points.toString() !== points.toString()) {
- var hoverPoints = bezierCurveToPolyline(points, 20);
- Object.assign(cache, {
- points: (0, util.deepClone)(points, true),
- hoverPoints: hoverPoints
- });
- }
-
- ctx.beginPath();
- (0, canvas.drawBezierCurvePath)(ctx, points.slice(1), points[0]);
-
- if (close) {
- ctx.closePath();
- ctx.fill();
- ctx.stroke();
- } else {
- ctx.stroke();
- }
- },
- hoverCheck: function hoverCheck(position, _ref77) {
- var cache = _ref77.cache,
- shape = _ref77.shape,
- style = _ref77.style;
- var hoverPoints = cache.hoverPoints;
- var close = shape.close;
- var lineWidth = style.lineWidth;
-
- if (close) {
- return (0, util.checkPointIsInPolygon)(position, hoverPoints);
- } else {
- return (0, util.checkPointIsNearPolyline)(position, hoverPoints, lineWidth);
- }
- },
- setGraphCenter: function setGraphCenter(e, _ref78) {
- var shape = _ref78.shape,
- style = _ref78.style;
- var points = shape.points;
- style.graphCenter = points[0];
- },
- move: function move(_ref79, _ref80) {
- var movementX = _ref79.movementX,
- movementY = _ref79.movementY;
- var shape = _ref80.shape,
- cache = _ref80.cache;
- var points = shape.points;
-
- var _points$ = (0, _slicedToArray2["default"])(points[0], 2),
- fx = _points$[0],
- fy = _points$[1];
-
- var curves = points.slice(1);
- var bezierCurve = [[fx + movementX, fy + movementY]].concat((0, _toConsumableArray2["default"])(curves.map(function (curve) {
- return curve.map(function (_ref81) {
- var _ref82 = (0, _slicedToArray2["default"])(_ref81, 2),
- x = _ref82[0],
- y = _ref82[1];
-
- return [x + movementX, y + movementY];
- });
- })));
- cache.points = bezierCurve;
- cache.hoverPoints = cache.hoverPoints.map(function (_ref83) {
- var _ref84 = (0, _slicedToArray2["default"])(_ref83, 2),
- x = _ref84[0],
- y = _ref84[1];
-
- return [x + movementX, y + movementY];
- });
- this.attr('shape', {
- points: bezierCurve
- });
- }
- };
- exports.bezierCurve = bezierCurve;
- var text = {
- shape: {
- content: '',
- position: [],
- maxWidth: undefined,
- rowGap: 0
- },
- validator: function validator(_ref85) {
- var shape = _ref85.shape;
- var content = shape.content,
- position = shape.position,
- rowGap = shape.rowGap;
-
- if (typeof content !== 'string') {
- console.error('Text content should be a string!');
- return false;
- }
-
- if (!(position instanceof Array)) {
- console.error('Text position should be an array!');
- return false;
- }
-
- if (typeof rowGap !== 'number') {
- console.error('Text rowGap should be a number!');
- return false;
- }
-
- return true;
- },
- draw: function draw(_ref86, _ref87) {
- var ctx = _ref86.ctx;
- var shape = _ref87.shape;
- var content = shape.content,
- position = shape.position,
- maxWidth = shape.maxWidth,
- rowGap = shape.rowGap;
- var textBaseline = ctx.textBaseline,
- font = ctx.font;
- var fontSize = parseInt(font.replace(/\D/g, ''));
-
- var _position = position,
- _position2 = (0, _slicedToArray2["default"])(_position, 2),
- x = _position2[0],
- y = _position2[1];
-
- content = content.split('\n');
- var rowNum = content.length;
- var lineHeight = fontSize + rowGap;
- var allHeight = rowNum * lineHeight - rowGap;
- var offset = 0;
-
- if (textBaseline === 'middle') {
- offset = allHeight / 2;
- y += fontSize / 2;
- }
-
- if (textBaseline === 'bottom') {
- offset = allHeight;
- y += fontSize;
- }
-
- position = new Array(rowNum).fill(0).map(function (foo, i) {
- return [x, y + i * lineHeight - offset];
- });
- ctx.beginPath();
- content.forEach(function (text, i) {
- ctx.fillText.apply(ctx, [text].concat((0, _toConsumableArray2["default"])(position[i]), [maxWidth]));
- ctx.strokeText.apply(ctx, [text].concat((0, _toConsumableArray2["default"])(position[i]), [maxWidth]));
- });
- ctx.closePath();
- },
- hoverCheck: function hoverCheck(position, _ref88) {
- var shape = _ref88.shape,
- style = _ref88.style;
- return false;
- },
- setGraphCenter: function setGraphCenter(e, _ref89) {
- var shape = _ref89.shape,
- style = _ref89.style;
- var position = shape.position;
- style.graphCenter = (0, _toConsumableArray2["default"])(position);
- },
- move: function move(_ref90, _ref91) {
- var movementX = _ref90.movementX,
- movementY = _ref90.movementY;
- var shape = _ref91.shape;
-
- var _shape$position = (0, _slicedToArray2["default"])(shape.position, 2),
- x = _shape$position[0],
- y = _shape$position[1];
-
- this.attr('shape', {
- position: [x + movementX, y + movementY]
- });
- }
- };
- exports.text = text;
- 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]]);
- var _default = graphs;
- /**
- * @description Extend new graph
- * @param {String} name Name of Graph
- * @param {Object} config Configuration of Graph
- * @return {Undefined} Void
- */
-
- exports["default"] = _default;
-
- function extendNewGraph(name, config) {
- if (!name || !config) {
- console.error('ExtendNewGraph Missing Parameters!');
- return;
- }
-
- if (!config.shape) {
- console.error('Required attribute of shape to extendNewGraph!');
- return;
- }
-
- if (!config.validator) {
- console.error('Required function of validator to extendNewGraph!');
- return;
- }
-
- if (!config.draw) {
- console.error('Required function of draw to extendNewGraph!');
- return;
- }
-
- graphs.set(name, config);
- }
- });
-
- unwrapExports(graphs_1);
- var graphs_2 = graphs_1.extendNewGraph;
- var graphs_3 = graphs_1.text;
- var graphs_4 = graphs_1.bezierCurve;
- var graphs_5 = graphs_1.smoothline;
- var graphs_6 = graphs_1.polyline;
- var graphs_7 = graphs_1.regPolygon;
- var graphs_8 = graphs_1.sector;
- var graphs_9 = graphs_1.arc;
- var graphs_10 = graphs_1.ring;
- var graphs_11 = graphs_1.rect;
- var graphs_12 = graphs_1.ellipse;
- var graphs_13 = graphs_1.circle;
-
- var runtime_1 = createCommonjsModule(function (module) {
- /**
- * Copyright (c) 2014-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
- var runtime = (function (exports) {
-
- var Op = Object.prototype;
- var hasOwn = Op.hasOwnProperty;
- var undefined$1; // More compressible than void 0.
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
-
- function wrap(innerFn, outerFn, self, tryLocsList) {
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
- var generator = Object.create(protoGenerator.prototype);
- var context = new Context(tryLocsList || []);
-
- // The ._invoke method unifies the implementations of the .next,
- // .throw, and .return methods.
- generator._invoke = makeInvokeMethod(innerFn, self, context);
-
- return generator;
- }
- exports.wrap = wrap;
-
- // Try/catch helper to minimize deoptimizations. Returns a completion
- // record like context.tryEntries[i].completion. This interface could
- // have been (and was previously) designed to take a closure to be
- // invoked without arguments, but in all the cases we care about we
- // already have an existing method we want to call, so there's no need
- // to create a new function object. We can even get away with assuming
- // the method takes exactly one argument, since that happens to be true
- // in every case, so we don't have to touch the arguments object. The
- // only additional allocation required is the completion record, which
- // has a stable shape and so hopefully should be cheap to allocate.
- function tryCatch(fn, obj, arg) {
- try {
- return { type: "normal", arg: fn.call(obj, arg) };
- } catch (err) {
- return { type: "throw", arg: err };
- }
- }
-
- var GenStateSuspendedStart = "suspendedStart";
- var GenStateSuspendedYield = "suspendedYield";
- var GenStateExecuting = "executing";
- var GenStateCompleted = "completed";
-
- // Returning this object from the innerFn has the same effect as
- // breaking out of the dispatch switch statement.
- var ContinueSentinel = {};
-
- // Dummy constructor functions that we use as the .constructor and
- // .constructor.prototype properties for functions that return Generator
- // objects. For full spec compliance, you may wish to configure your
- // minifier not to mangle the names of these two functions.
- function Generator() {}
- function GeneratorFunction() {}
- function GeneratorFunctionPrototype() {}
-
- // This is a polyfill for %IteratorPrototype% for environments that
- // don't natively support it.
- var IteratorPrototype = {};
- IteratorPrototype[iteratorSymbol] = function () {
- return this;
- };
-
- var getProto = Object.getPrototypeOf;
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
- if (NativeIteratorPrototype &&
- NativeIteratorPrototype !== Op &&
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
- // This environment has a native %IteratorPrototype%; use it instead
- // of the polyfill.
- IteratorPrototype = NativeIteratorPrototype;
- }
-
- var Gp = GeneratorFunctionPrototype.prototype =
- Generator.prototype = Object.create(IteratorPrototype);
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
- GeneratorFunctionPrototype[toStringTagSymbol] =
- GeneratorFunction.displayName = "GeneratorFunction";
-
- // Helper for defining the .next, .throw, and .return methods of the
- // Iterator interface in terms of a single ._invoke method.
- function defineIteratorMethods(prototype) {
- ["next", "throw", "return"].forEach(function(method) {
- prototype[method] = function(arg) {
- return this._invoke(method, arg);
- };
- });
- }
-
- exports.isGeneratorFunction = function(genFun) {
- var ctor = typeof genFun === "function" && genFun.constructor;
- return ctor
- ? ctor === GeneratorFunction ||
- // For the native GeneratorFunction constructor, the best we can
- // do is to check its .name property.
- (ctor.displayName || ctor.name) === "GeneratorFunction"
- : false;
- };
-
- exports.mark = function(genFun) {
- if (Object.setPrototypeOf) {
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
- } else {
- genFun.__proto__ = GeneratorFunctionPrototype;
- if (!(toStringTagSymbol in genFun)) {
- genFun[toStringTagSymbol] = "GeneratorFunction";
- }
- }
- genFun.prototype = Object.create(Gp);
- return genFun;
- };
-
- // Within the body of any async function, `await x` is transformed to
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
- // meant to be awaited.
- exports.awrap = function(arg) {
- return { __await: arg };
- };
-
- function AsyncIterator(generator, PromiseImpl) {
- function invoke(method, arg, resolve, reject) {
- var record = tryCatch(generator[method], generator, arg);
- if (record.type === "throw") {
- reject(record.arg);
- } else {
- var result = record.arg;
- var value = result.value;
- if (value &&
- typeof value === "object" &&
- hasOwn.call(value, "__await")) {
- return PromiseImpl.resolve(value.__await).then(function(value) {
- invoke("next", value, resolve, reject);
- }, function(err) {
- invoke("throw", err, resolve, reject);
- });
- }
-
- return PromiseImpl.resolve(value).then(function(unwrapped) {
- // When a yielded Promise is resolved, its final value becomes
- // the .value of the Promise<{value,done}> result for the
- // current iteration.
- result.value = unwrapped;
- resolve(result);
- }, function(error) {
- // If a rejected Promise was yielded, throw the rejection back
- // into the async generator function so it can be handled there.
- return invoke("throw", error, resolve, reject);
- });
- }
- }
-
- var previousPromise;
-
- function enqueue(method, arg) {
- function callInvokeWithMethodAndArg() {
- return new PromiseImpl(function(resolve, reject) {
- invoke(method, arg, resolve, reject);
- });
- }
-
- return previousPromise =
- // If enqueue has been called before, then we want to wait until
- // all previous Promises have been resolved before calling invoke,
- // so that results are always delivered in the correct order. If
- // enqueue has not been called before, then it is important to
- // call invoke immediately, without waiting on a callback to fire,
- // so that the async generator function has the opportunity to do
- // any necessary setup in a predictable way. This predictability
- // is why the Promise constructor synchronously invokes its
- // executor callback, and why async functions synchronously
- // execute code before the first await. Since we implement simple
- // async functions in terms of async generators, it is especially
- // important to get this right, even though it requires care.
- previousPromise ? previousPromise.then(
- callInvokeWithMethodAndArg,
- // Avoid propagating failures to Promises returned by later
- // invocations of the iterator.
- callInvokeWithMethodAndArg
- ) : callInvokeWithMethodAndArg();
- }
-
- // Define the unified helper method that is used to implement .next,
- // .throw, and .return (see defineIteratorMethods).
- this._invoke = enqueue;
- }
-
- defineIteratorMethods(AsyncIterator.prototype);
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
- return this;
- };
- exports.AsyncIterator = AsyncIterator;
-
- // Note that simple async functions are implemented on top of
- // AsyncIterator objects; they just return a Promise for the value of
- // the final result produced by the iterator.
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
- if (PromiseImpl === void 0) PromiseImpl = Promise;
-
- var iter = new AsyncIterator(
- wrap(innerFn, outerFn, self, tryLocsList),
- PromiseImpl
- );
-
- return exports.isGeneratorFunction(outerFn)
- ? iter // If outerFn is a generator, return the full iterator.
- : iter.next().then(function(result) {
- return result.done ? result.value : iter.next();
- });
- };
-
- function makeInvokeMethod(innerFn, self, context) {
- var state = GenStateSuspendedStart;
-
- return function invoke(method, arg) {
- if (state === GenStateExecuting) {
- throw new Error("Generator is already running");
- }
-
- if (state === GenStateCompleted) {
- if (method === "throw") {
- throw arg;
- }
-
- // Be forgiving, per 25.3.3.3.3 of the spec:
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
- return doneResult();
- }
-
- context.method = method;
- context.arg = arg;
-
- while (true) {
- var delegate = context.delegate;
- if (delegate) {
- var delegateResult = maybeInvokeDelegate(delegate, context);
- if (delegateResult) {
- if (delegateResult === ContinueSentinel) continue;
- return delegateResult;
- }
- }
-
- if (context.method === "next") {
- // Setting context._sent for legacy support of Babel's
- // function.sent implementation.
- context.sent = context._sent = context.arg;
-
- } else if (context.method === "throw") {
- if (state === GenStateSuspendedStart) {
- state = GenStateCompleted;
- throw context.arg;
- }
-
- context.dispatchException(context.arg);
-
- } else if (context.method === "return") {
- context.abrupt("return", context.arg);
- }
-
- state = GenStateExecuting;
-
- var record = tryCatch(innerFn, self, context);
- if (record.type === "normal") {
- // If an exception is thrown from innerFn, we leave state ===
- // GenStateExecuting and loop back for another invocation.
- state = context.done
- ? GenStateCompleted
- : GenStateSuspendedYield;
-
- if (record.arg === ContinueSentinel) {
- continue;
- }
-
- return {
- value: record.arg,
- done: context.done
- };
-
- } else if (record.type === "throw") {
- state = GenStateCompleted;
- // Dispatch the exception by looping back around to the
- // context.dispatchException(context.arg) call above.
- context.method = "throw";
- context.arg = record.arg;
- }
- }
- };
- }
-
- // Call delegate.iterator[context.method](context.arg) and handle the
- // result, either by returning a { value, done } result from the
- // delegate iterator, or by modifying context.method and context.arg,
- // setting context.delegate to null, and returning the ContinueSentinel.
- function maybeInvokeDelegate(delegate, context) {
- var method = delegate.iterator[context.method];
- if (method === undefined$1) {
- // A .throw or .return when the delegate iterator has no .throw
- // method always terminates the yield* loop.
- context.delegate = null;
-
- if (context.method === "throw") {
- // Note: ["return"] must be used for ES3 parsing compatibility.
- if (delegate.iterator["return"]) {
- // If the delegate iterator has a return method, give it a
- // chance to clean up.
- context.method = "return";
- context.arg = undefined$1;
- maybeInvokeDelegate(delegate, context);
-
- if (context.method === "throw") {
- // If maybeInvokeDelegate(context) changed context.method from
- // "return" to "throw", let that override the TypeError below.
- return ContinueSentinel;
- }
- }
-
- context.method = "throw";
- context.arg = new TypeError(
- "The iterator does not provide a 'throw' method");
- }
-
- return ContinueSentinel;
- }
-
- var record = tryCatch(method, delegate.iterator, context.arg);
-
- if (record.type === "throw") {
- context.method = "throw";
- context.arg = record.arg;
- context.delegate = null;
- return ContinueSentinel;
- }
-
- var info = record.arg;
-
- if (! info) {
- context.method = "throw";
- context.arg = new TypeError("iterator result is not an object");
- context.delegate = null;
- return ContinueSentinel;
- }
-
- if (info.done) {
- // Assign the result of the finished delegate to the temporary
- // variable specified by delegate.resultName (see delegateYield).
- context[delegate.resultName] = info.value;
-
- // Resume execution at the desired location (see delegateYield).
- context.next = delegate.nextLoc;
-
- // If context.method was "throw" but the delegate handled the
- // exception, let the outer generator proceed normally. If
- // context.method was "next", forget context.arg since it has been
- // "consumed" by the delegate iterator. If context.method was
- // "return", allow the original .return call to continue in the
- // outer generator.
- if (context.method !== "return") {
- context.method = "next";
- context.arg = undefined$1;
- }
-
- } else {
- // Re-yield the result returned by the delegate method.
- return info;
- }
-
- // The delegate iterator is finished, so forget it and continue with
- // the outer generator.
- context.delegate = null;
- return ContinueSentinel;
- }
-
- // Define Generator.prototype.{next,throw,return} in terms of the
- // unified ._invoke helper method.
- defineIteratorMethods(Gp);
-
- Gp[toStringTagSymbol] = "Generator";
-
- // A Generator should always return itself as the iterator object when the
- // @@iterator function is called on it. Some browsers' implementations of the
- // iterator prototype chain incorrectly implement this, causing the Generator
- // object to not be returned from this call. This ensures that doesn't happen.
- // See https://github.com/facebook/regenerator/issues/274 for more details.
- Gp[iteratorSymbol] = function() {
- return this;
- };
-
- Gp.toString = function() {
- return "[object Generator]";
- };
-
- function pushTryEntry(locs) {
- var entry = { tryLoc: locs[0] };
-
- if (1 in locs) {
- entry.catchLoc = locs[1];
- }
-
- if (2 in locs) {
- entry.finallyLoc = locs[2];
- entry.afterLoc = locs[3];
- }
-
- this.tryEntries.push(entry);
- }
-
- function resetTryEntry(entry) {
- var record = entry.completion || {};
- record.type = "normal";
- delete record.arg;
- entry.completion = record;
- }
-
- function Context(tryLocsList) {
- // The root entry object (effectively a try statement without a catch
- // or a finally block) gives us a place to store values thrown from
- // locations where there is no enclosing try statement.
- this.tryEntries = [{ tryLoc: "root" }];
- tryLocsList.forEach(pushTryEntry, this);
- this.reset(true);
- }
-
- exports.keys = function(object) {
- var keys = [];
- for (var key in object) {
- keys.push(key);
- }
- keys.reverse();
-
- // Rather than returning an object with a next method, we keep
- // things simple and return the next function itself.
- return function next() {
- while (keys.length) {
- var key = keys.pop();
- if (key in object) {
- next.value = key;
- next.done = false;
- return next;
- }
- }
-
- // To avoid creating an additional object, we just hang the .value
- // and .done properties off the next function object itself. This
- // also ensures that the minifier will not anonymize the function.
- next.done = true;
- return next;
- };
- };
-
- function values(iterable) {
- if (iterable) {
- var iteratorMethod = iterable[iteratorSymbol];
- if (iteratorMethod) {
- return iteratorMethod.call(iterable);
- }
-
- if (typeof iterable.next === "function") {
- return iterable;
- }
-
- if (!isNaN(iterable.length)) {
- var i = -1, next = function next() {
- while (++i < iterable.length) {
- if (hasOwn.call(iterable, i)) {
- next.value = iterable[i];
- next.done = false;
- return next;
- }
- }
-
- next.value = undefined$1;
- next.done = true;
-
- return next;
- };
-
- return next.next = next;
- }
- }
-
- // Return an iterator with no values.
- return { next: doneResult };
- }
- exports.values = values;
-
- function doneResult() {
- return { value: undefined$1, done: true };
- }
-
- Context.prototype = {
- constructor: Context,
-
- reset: function(skipTempReset) {
- this.prev = 0;
- this.next = 0;
- // Resetting context._sent for legacy support of Babel's
- // function.sent implementation.
- this.sent = this._sent = undefined$1;
- this.done = false;
- this.delegate = null;
-
- this.method = "next";
- this.arg = undefined$1;
-
- this.tryEntries.forEach(resetTryEntry);
-
- if (!skipTempReset) {
- for (var name in this) {
- // Not sure about the optimal order of these conditions:
- if (name.charAt(0) === "t" &&
- hasOwn.call(this, name) &&
- !isNaN(+name.slice(1))) {
- this[name] = undefined$1;
- }
- }
- }
- },
-
- stop: function() {
- this.done = true;
-
- var rootEntry = this.tryEntries[0];
- var rootRecord = rootEntry.completion;
- if (rootRecord.type === "throw") {
- throw rootRecord.arg;
- }
-
- return this.rval;
- },
-
- dispatchException: function(exception) {
- if (this.done) {
- throw exception;
- }
-
- var context = this;
- function handle(loc, caught) {
- record.type = "throw";
- record.arg = exception;
- context.next = loc;
-
- if (caught) {
- // If the dispatched exception was caught by a catch block,
- // then let that catch block handle the exception normally.
- context.method = "next";
- context.arg = undefined$1;
- }
-
- return !! caught;
- }
-
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- var record = entry.completion;
-
- if (entry.tryLoc === "root") {
- // Exception thrown outside of any try block that could handle
- // it, so set the completion value of the entire function to
- // throw the exception.
- return handle("end");
- }
-
- if (entry.tryLoc <= this.prev) {
- var hasCatch = hasOwn.call(entry, "catchLoc");
- var hasFinally = hasOwn.call(entry, "finallyLoc");
-
- if (hasCatch && hasFinally) {
- if (this.prev < entry.catchLoc) {
- return handle(entry.catchLoc, true);
- } else if (this.prev < entry.finallyLoc) {
- return handle(entry.finallyLoc);
- }
-
- } else if (hasCatch) {
- if (this.prev < entry.catchLoc) {
- return handle(entry.catchLoc, true);
- }
-
- } else if (hasFinally) {
- if (this.prev < entry.finallyLoc) {
- return handle(entry.finallyLoc);
- }
-
- } else {
- throw new Error("try statement without catch or finally");
- }
- }
- }
- },
-
- abrupt: function(type, arg) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.tryLoc <= this.prev &&
- hasOwn.call(entry, "finallyLoc") &&
- this.prev < entry.finallyLoc) {
- var finallyEntry = entry;
- break;
- }
- }
-
- if (finallyEntry &&
- (type === "break" ||
- type === "continue") &&
- finallyEntry.tryLoc <= arg &&
- arg <= finallyEntry.finallyLoc) {
- // Ignore the finally entry if control is not jumping to a
- // location outside the try/catch block.
- finallyEntry = null;
- }
-
- var record = finallyEntry ? finallyEntry.completion : {};
- record.type = type;
- record.arg = arg;
-
- if (finallyEntry) {
- this.method = "next";
- this.next = finallyEntry.finallyLoc;
- return ContinueSentinel;
- }
-
- return this.complete(record);
- },
-
- complete: function(record, afterLoc) {
- if (record.type === "throw") {
- throw record.arg;
- }
-
- if (record.type === "break" ||
- record.type === "continue") {
- this.next = record.arg;
- } else if (record.type === "return") {
- this.rval = this.arg = record.arg;
- this.method = "return";
- this.next = "end";
- } else if (record.type === "normal" && afterLoc) {
- this.next = afterLoc;
- }
-
- return ContinueSentinel;
- },
-
- finish: function(finallyLoc) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.finallyLoc === finallyLoc) {
- this.complete(entry.completion, entry.afterLoc);
- resetTryEntry(entry);
- return ContinueSentinel;
- }
- }
- },
-
- "catch": function(tryLoc) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.tryLoc === tryLoc) {
- var record = entry.completion;
- if (record.type === "throw") {
- var thrown = record.arg;
- resetTryEntry(entry);
- }
- return thrown;
- }
- }
-
- // The context.catch method must only be called with a location
- // argument that corresponds to a known catch block.
- throw new Error("illegal catch attempt");
- },
-
- delegateYield: function(iterable, resultName, nextLoc) {
- this.delegate = {
- iterator: values(iterable),
- resultName: resultName,
- nextLoc: nextLoc
- };
-
- if (this.method === "next") {
- // Deliberately forget the last sent value so that we don't
- // accidentally pass it on to the delegate.
- this.arg = undefined$1;
- }
-
- return ContinueSentinel;
- }
- };
-
- // Regardless of whether this script is executing as a CommonJS module
- // or not, return the runtime object so that we can declare the variable
- // regeneratorRuntime in the outer scope, which allows this module to be
- // injected easily by `bin/regenerator --include-runtime script.js`.
- return exports;
-
- }(
- // If this script is executing as a CommonJS module, use module.exports
- // as the regeneratorRuntime namespace. Otherwise create a new empty
- // object. Either way, the resulting object will be used to initialize
- // the regeneratorRuntime variable at the top of this file.
- module.exports
- ));
-
- try {
- regeneratorRuntime = runtime;
- } catch (accidentalStrictMode) {
- // This module should not be running in strict mode, so the above
- // assignment should always work unless something is misconfigured. Just
- // in case runtime.js accidentally runs in strict mode, we can escape
- // strict mode using a global Function call. This could conceivably fail
- // if a Content Security Policy forbids using Function, but in that case
- // the proper solution is to fix the accidental strict mode problem. If
- // you've misconfigured your bundler to force strict mode and applied a
- // CSP to forbid Function, and you're not willing to fix either of those
- // problems, please detail your unique predicament in a GitHub issue.
- Function("r", "regeneratorRuntime = r")(runtime);
- }
- });
-
- var regenerator = runtime_1;
-
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
- try {
- var info = gen[key](arg);
- var value = info.value;
- } catch (error) {
- reject(error);
- return;
- }
-
- if (info.done) {
- resolve(value);
- } else {
- Promise.resolve(value).then(_next, _throw);
- }
- }
-
- function _asyncToGenerator(fn) {
- return function () {
- var self = this,
- args = arguments;
- return new Promise(function (resolve, reject) {
- var gen = fn.apply(self, args);
-
- function _next(value) {
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
- }
-
- function _throw(err) {
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
- }
-
- _next(undefined);
- });
- };
- }
-
- var asyncToGenerator = _asyncToGenerator;
-
- var style_class = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
- var _classCallCheck2 = interopRequireDefault(classCallCheck);
-
-
-
-
-
- /**
- * @description Class Style
- * @param {Object} style Style configuration
- * @return {Style} Instance of Style
- */
- var Style = function Style(style) {
- (0, _classCallCheck2["default"])(this, Style);
- this.colorProcessor(style);
- var defaultStyle = {
- /**
- * @description Rgba value of graph fill color
- * @type {Array}
- * @default fill = [0, 0, 0, 1]
- */
- fill: [0, 0, 0, 1],
-
- /**
- * @description Rgba value of graph stroke color
- * @type {Array}
- * @default stroke = [0, 0, 0, 1]
- */
- stroke: [0, 0, 0, 0],
-
- /**
- * @description Opacity of graph
- * @type {Number}
- * @default opacity = 1
- */
- opacity: 1,
-
- /**
- * @description LineCap of Ctx
- * @type {String}
- * @default lineCap = null
- * @example lineCap = 'butt'|'round'|'square'
- */
- lineCap: null,
-
- /**
- * @description Linejoin of Ctx
- * @type {String}
- * @default lineJoin = null
- * @example lineJoin = 'round'|'bevel'|'miter'
- */
- lineJoin: null,
-
- /**
- * @description LineDash of Ctx
- * @type {Array}
- * @default lineDash = null
- * @example lineDash = [10, 10]
- */
- lineDash: null,
-
- /**
- * @description LineDashOffset of Ctx
- * @type {Number}
- * @default lineDashOffset = null
- * @example lineDashOffset = 10
- */
- lineDashOffset: null,
-
- /**
- * @description ShadowBlur of Ctx
- * @type {Number}
- * @default shadowBlur = 0
- */
- shadowBlur: 0,
-
- /**
- * @description Rgba value of graph shadow color
- * @type {Array}
- * @default shadowColor = [0, 0, 0, 0]
- */
- shadowColor: [0, 0, 0, 0],
-
- /**
- * @description ShadowOffsetX of Ctx
- * @type {Number}
- * @default shadowOffsetX = 0
- */
- shadowOffsetX: 0,
-
- /**
- * @description ShadowOffsetY of Ctx
- * @type {Number}
- * @default shadowOffsetY = 0
- */
- shadowOffsetY: 0,
-
- /**
- * @description LineWidth of Ctx
- * @type {Number}
- * @default lineWidth = 0
- */
- lineWidth: 0,
-
- /**
- * @description Center point of the graph
- * @type {Array}
- * @default graphCenter = null
- * @example graphCenter = [10, 10]
- */
- graphCenter: null,
-
- /**
- * @description Graph scale
- * @type {Array}
- * @default scale = null
- * @example scale = [1.5, 1.5]
- */
- scale: null,
-
- /**
- * @description Graph rotation degree
- * @type {Number}
- * @default rotate = null
- * @example rotate = 10
- */
- rotate: null,
-
- /**
- * @description Graph translate distance
- * @type {Array}
- * @default translate = null
- * @example translate = [10, 10]
- */
- translate: null,
-
- /**
- * @description Cursor status when hover
- * @type {String}
- * @default hoverCursor = 'pointer'
- * @example hoverCursor = 'default'|'pointer'|'auto'|'crosshair'|'move'|'wait'|...
- */
- hoverCursor: 'pointer',
-
- /**
- * @description Font style of Ctx
- * @type {String}
- * @default fontStyle = 'normal'
- * @example fontStyle = 'normal'|'italic'|'oblique'
- */
- fontStyle: 'normal',
-
- /**
- * @description Font varient of Ctx
- * @type {String}
- * @default fontVarient = 'normal'
- * @example fontVarient = 'normal'|'small-caps'
- */
- fontVarient: 'normal',
-
- /**
- * @description Font weight of Ctx
- * @type {String|Number}
- * @default fontWeight = 'normal'
- * @example fontWeight = 'normal'|'bold'|'bolder'|'lighter'|Number
- */
- fontWeight: 'normal',
-
- /**
- * @description Font size of Ctx
- * @type {Number}
- * @default fontSize = 10
- */
- fontSize: 10,
-
- /**
- * @description Font family of Ctx
- * @type {String}
- * @default fontFamily = 'Arial'
- */
- fontFamily: 'Arial',
-
- /**
- * @description TextAlign of Ctx
- * @type {String}
- * @default textAlign = 'center'
- * @example textAlign = 'start'|'end'|'left'|'right'|'center'
- */
- textAlign: 'center',
-
- /**
- * @description TextBaseline of Ctx
- * @type {String}
- * @default textBaseline = 'middle'
- * @example textBaseline = 'top'|'bottom'|'middle'|'alphabetic'|'hanging'
- */
- textBaseline: 'middle',
-
- /**
- * @description The color used to create the gradient
- * @type {Array}
- * @default gradientColor = null
- * @example gradientColor = ['#000', '#111', '#222']
- */
- gradientColor: null,
-
- /**
- * @description Gradient type
- * @type {String}
- * @default gradientType = 'linear'
- * @example gradientType = 'linear' | 'radial'
- */
- gradientType: 'linear',
-
- /**
- * @description Gradient params
- * @type {Array}
- * @default gradientParams = null
- * @example gradientParams = [x0, y0, x1, y1] (Linear Gradient)
- * @example gradientParams = [x0, y0, r0, x1, y1, r1] (Radial Gradient)
- */
- gradientParams: null,
-
- /**
- * @description When to use gradients
- * @type {String}
- * @default gradientWith = 'stroke'
- * @example gradientWith = 'stroke' | 'fill'
- */
- gradientWith: 'stroke',
-
- /**
- * @description Gradient color stops
- * @type {String}
- * @default gradientStops = 'auto'
- * @example gradientStops = 'auto' | [0, .2, .3, 1]
- */
- gradientStops: 'auto',
-
- /**
- * @description Extended color that supports animation transition
- * @type {Array|Object}
- * @default colors = null
- * @example colors = ['#000', '#111', '#222', 'red' ]
- * @example colors = { a: '#000', b: '#111' }
- */
- colors: null
- };
- Object.assign(this, defaultStyle, style);
- };
- /**
- * @description Set colors to rgba value
- * @param {Object} style style config
- * @param {Boolean} reverse Whether to perform reverse operation
- * @return {Undefined} Void
- */
-
-
- exports["default"] = Style;
-
- Style.prototype.colorProcessor = function (style) {
- var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var processor = reverse ? lib.getColorFromRgbValue : lib.getRgbaValue;
- var colorProcessorKeys = ['fill', 'stroke', 'shadowColor'];
- var allKeys = Object.keys(style);
- var colorKeys = allKeys.filter(function (key) {
- return colorProcessorKeys.find(function (k) {
- return k === key;
- });
- });
- colorKeys.forEach(function (key) {
- return style[key] = processor(style[key]);
- });
- var gradientColor = style.gradientColor,
- colors = style.colors;
- if (gradientColor) style.gradientColor = gradientColor.map(function (c) {
- return processor(c);
- });
-
- if (colors) {
- var colorsKeys = Object.keys(colors);
- colorsKeys.forEach(function (key) {
- return colors[key] = processor(colors[key]);
- });
- }
- };
- /**
- * @description Init graph style
- * @param {Object} ctx Context of canvas
- * @return {Undefined} Void
- */
-
-
- Style.prototype.initStyle = function (ctx) {
- initTransform(ctx, this);
- initGraphStyle(ctx, this);
- initGradient(ctx, this);
- };
- /**
- * @description Init canvas transform
- * @param {Object} ctx Context of canvas
- * @param {Style} style Instance of Style
- * @return {Undefined} Void
- */
-
-
- function initTransform(ctx, style) {
- ctx.save();
- var graphCenter = style.graphCenter,
- rotate = style.rotate,
- scale = style.scale,
- translate = style.translate;
- if (!(graphCenter instanceof Array)) return;
- ctx.translate.apply(ctx, (0, _toConsumableArray2["default"])(graphCenter));
- if (rotate) ctx.rotate(rotate * Math.PI / 180);
- if (scale instanceof Array) ctx.scale.apply(ctx, (0, _toConsumableArray2["default"])(scale));
- if (translate) ctx.translate.apply(ctx, (0, _toConsumableArray2["default"])(translate));
- ctx.translate(-graphCenter[0], -graphCenter[1]);
- }
-
- var autoSetStyleKeys = ['lineCap', 'lineJoin', 'lineDashOffset', 'shadowOffsetX', 'shadowOffsetY', 'lineWidth', 'textAlign', 'textBaseline'];
- /**
- * @description Set the style of canvas ctx
- * @param {Object} ctx Context of canvas
- * @param {Style} style Instance of Style
- * @return {Undefined} Void
- */
-
- function initGraphStyle(ctx, style) {
- var fill = style.fill,
- stroke = style.stroke,
- shadowColor = style.shadowColor,
- opacity = style.opacity;
- autoSetStyleKeys.forEach(function (key) {
- if (key || typeof key === 'number') ctx[key] = style[key];
- });
- fill = (0, _toConsumableArray2["default"])(fill);
- stroke = (0, _toConsumableArray2["default"])(stroke);
- shadowColor = (0, _toConsumableArray2["default"])(shadowColor);
- fill[3] *= opacity;
- stroke[3] *= opacity;
- shadowColor[3] *= opacity;
- ctx.fillStyle = (0, lib.getColorFromRgbValue)(fill);
- ctx.strokeStyle = (0, lib.getColorFromRgbValue)(stroke);
- ctx.shadowColor = (0, lib.getColorFromRgbValue)(shadowColor);
- var lineDash = style.lineDash,
- shadowBlur = style.shadowBlur;
-
- if (lineDash) {
- lineDash = lineDash.map(function (v) {
- return v >= 0 ? v : 0;
- });
- ctx.setLineDash(lineDash);
- }
-
- if (typeof shadowBlur === 'number') ctx.shadowBlur = shadowBlur > 0 ? shadowBlur : 0.001;
- var fontStyle = style.fontStyle,
- fontVarient = style.fontVarient,
- fontWeight = style.fontWeight,
- fontSize = style.fontSize,
- fontFamily = style.fontFamily;
- ctx.font = fontStyle + ' ' + fontVarient + ' ' + fontWeight + ' ' + fontSize + 'px' + ' ' + fontFamily;
- }
- /**
- * @description Set the gradient color of canvas ctx
- * @param {Object} ctx Context of canvas
- * @param {Style} style Instance of Style
- * @return {Undefined} Void
- */
-
-
- function initGradient(ctx, style) {
- if (!gradientValidator(style)) return;
- var gradientColor = style.gradientColor,
- gradientParams = style.gradientParams,
- gradientType = style.gradientType,
- gradientWith = style.gradientWith,
- gradientStops = style.gradientStops,
- opacity = style.opacity;
- gradientColor = gradientColor.map(function (color) {
- var colorOpacity = color[3] * opacity;
- var clonedColor = (0, _toConsumableArray2["default"])(color);
- clonedColor[3] = colorOpacity;
- return clonedColor;
- });
- gradientColor = gradientColor.map(function (c) {
- return (0, lib.getColorFromRgbValue)(c);
- });
- if (gradientStops === 'auto') gradientStops = getAutoColorStops(gradientColor);
- var gradient = ctx["create".concat(gradientType.slice(0, 1).toUpperCase() + gradientType.slice(1), "Gradient")].apply(ctx, (0, _toConsumableArray2["default"])(gradientParams));
- gradientStops.forEach(function (stop, i) {
- return gradient.addColorStop(stop, gradientColor[i]);
- });
- ctx["".concat(gradientWith, "Style")] = gradient;
- }
- /**
- * @description Check if the gradient configuration is legal
- * @param {Style} style Instance of Style
- * @return {Boolean} Check Result
- */
-
-
- function gradientValidator(style) {
- var gradientColor = style.gradientColor,
- gradientParams = style.gradientParams,
- gradientType = style.gradientType,
- gradientWith = style.gradientWith,
- gradientStops = style.gradientStops;
- if (!gradientColor || !gradientParams) return false;
-
- if (gradientColor.length === 1) {
- console.warn('The gradient needs to provide at least two colors');
- return false;
- }
-
- if (gradientType !== 'linear' && gradientType !== 'radial') {
- console.warn('GradientType only supports linear or radial, current value is ' + gradientType);
- return false;
- }
-
- var gradientParamsLength = gradientParams.length;
-
- if (gradientType === 'linear' && gradientParamsLength !== 4 || gradientType === 'radial' && gradientParamsLength !== 6) {
- console.warn('The expected length of gradientParams is ' + (gradientType === 'linear' ? '4' : '6'));
- return false;
- }
-
- if (gradientWith !== 'fill' && gradientWith !== 'stroke') {
- console.warn('GradientWith only supports fill or stroke, current value is ' + gradientWith);
- return false;
- }
-
- if (gradientStops !== 'auto' && !(gradientStops instanceof Array)) {
- console.warn("gradientStops only supports 'auto' or Number Array ([0, .5, 1]), current value is " + gradientStops);
- return false;
- }
-
- return true;
- }
- /**
- * @description Get a uniform gradient color stop
- * @param {Array} color Gradient color
- * @return {Array} Gradient color stop
- */
-
-
- function getAutoColorStops(color) {
- var stopGap = 1 / (color.length - 1);
- return color.map(function (foo, i) {
- return stopGap * i;
- });
- }
- /**
- * @description Restore canvas ctx transform
- * @param {Object} ctx Context of canvas
- * @return {Undefined} Void
- */
-
-
- Style.prototype.restoreTransform = function (ctx) {
- ctx.restore();
- };
- /**
- * @description Update style data
- * @param {Object} change Changed data
- * @return {Undefined} Void
- */
-
-
- Style.prototype.update = function (change) {
- this.colorProcessor(change);
- Object.assign(this, change);
- };
- /**
- * @description Get the current style configuration
- * @return {Object} Style configuration
- */
-
-
- Style.prototype.getStyle = function () {
- var clonedStyle = (0, util.deepClone)(this, true);
- this.colorProcessor(clonedStyle, true);
- return clonedStyle;
- };
- });
-
- unwrapExports(style_class);
-
- var curves = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- 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;
- var linear = [[[0, 1], '', [0.33, 0.67]], [[1, 0], [0.67, 0.33]]];
- /**
- * @description Sine
- */
-
- exports.linear = linear;
- var easeInSine = [[[0, 1]], [[0.538, 0.564], [0.169, 0.912], [0.880, 0.196]], [[1, 0]]];
- exports.easeInSine = easeInSine;
- var easeOutSine = [[[0, 1]], [[0.444, 0.448], [0.169, 0.736], [0.718, 0.16]], [[1, 0]]];
- exports.easeOutSine = easeOutSine;
- var easeInOutSine = [[[0, 1]], [[0.5, 0.5], [0.2, 1], [0.8, 0]], [[1, 0]]];
- /**
- * @description Quad
- */
-
- exports.easeInOutSine = easeInOutSine;
- var easeInQuad = [[[0, 1]], [[0.550, 0.584], [0.231, 0.904], [0.868, 0.264]], [[1, 0]]];
- exports.easeInQuad = easeInQuad;
- var easeOutQuad = [[[0, 1]], [[0.413, 0.428], [0.065, 0.816], [0.760, 0.04]], [[1, 0]]];
- exports.easeOutQuad = easeOutQuad;
- var easeInOutQuad = [[[0, 1]], [[0.5, 0.5], [0.3, 0.9], [0.7, 0.1]], [[1, 0]]];
- /**
- * @description Cubic
- */
-
- exports.easeInOutQuad = easeInOutQuad;
- var easeInCubic = [[[0, 1]], [[0.679, 0.688], [0.366, 0.992], [0.992, 0.384]], [[1, 0]]];
- exports.easeInCubic = easeInCubic;
- var easeOutCubic = [[[0, 1]], [[0.321, 0.312], [0.008, 0.616], [0.634, 0.008]], [[1, 0]]];
- exports.easeOutCubic = easeOutCubic;
- var easeInOutCubic = [[[0, 1]], [[0.5, 0.5], [0.3, 1], [0.7, 0]], [[1, 0]]];
- /**
- * @description Quart
- */
-
- exports.easeInOutCubic = easeInOutCubic;
- var easeInQuart = [[[0, 1]], [[0.812, 0.74], [0.611, 0.988], [1.013, 0.492]], [[1, 0]]];
- exports.easeInQuart = easeInQuart;
- var easeOutQuart = [[[0, 1]], [[0.152, 0.244], [0.001, 0.448], [0.285, -0.02]], [[1, 0]]];
- exports.easeOutQuart = easeOutQuart;
- var easeInOutQuart = [[[0, 1]], [[0.5, 0.5], [0.4, 1], [0.6, 0]], [[1, 0]]];
- /**
- * @description Quint
- */
-
- exports.easeInOutQuart = easeInOutQuart;
- var easeInQuint = [[[0, 1]], [[0.857, 0.856], [0.714, 1], [1, 0.712]], [[1, 0]]];
- exports.easeInQuint = easeInQuint;
- var easeOutQuint = [[[0, 1]], [[0.108, 0.2], [0.001, 0.4], [0.214, -0.012]], [[1, 0]]];
- exports.easeOutQuint = easeOutQuint;
- var easeInOutQuint = [[[0, 1]], [[0.5, 0.5], [0.5, 1], [0.5, 0]], [[1, 0]]];
- /**
- * @description Back
- */
-
- exports.easeInOutQuint = easeInOutQuint;
- var easeInBack = [[[0, 1]], [[0.667, 0.896], [0.380, 1.184], [0.955, 0.616]], [[1, 0]]];
- exports.easeInBack = easeInBack;
- var easeOutBack = [[[0, 1]], [[0.335, 0.028], [0.061, 0.22], [0.631, -0.18]], [[1, 0]]];
- exports.easeOutBack = easeOutBack;
- var easeInOutBack = [[[0, 1]], [[0.5, 0.5], [0.4, 1.4], [0.6, -0.4]], [[1, 0]]];
- /**
- * @description Elastic
- */
-
- exports.easeInOutBack = easeInOutBack;
- 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]]];
- exports.easeInElastic = easeInElastic;
- 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]]];
- exports.easeOutElastic = easeOutElastic;
- 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]]];
- /**
- * @description Bounce
- */
-
- exports.easeInOutElastic = easeInOutElastic;
- 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]]];
- exports.easeInBounce = easeInBounce;
- 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]]];
- exports.easeOutBounce = easeOutBounce;
- 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]]];
- exports.easeInOutBounce = easeInOutBounce;
-
- 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]]);
-
- exports["default"] = _default;
- });
-
- unwrapExports(curves);
- var curves_1 = curves.easeInOutBounce;
- var curves_2 = curves.easeOutBounce;
- var curves_3 = curves.easeInBounce;
- var curves_4 = curves.easeInOutElastic;
- var curves_5 = curves.easeOutElastic;
- var curves_6 = curves.easeInElastic;
- var curves_7 = curves.easeInOutBack;
- var curves_8 = curves.easeOutBack;
- var curves_9 = curves.easeInBack;
- var curves_10 = curves.easeInOutQuint;
- var curves_11 = curves.easeOutQuint;
- var curves_12 = curves.easeInQuint;
- var curves_13 = curves.easeInOutQuart;
- var curves_14 = curves.easeOutQuart;
- var curves_15 = curves.easeInQuart;
- var curves_16 = curves.easeInOutCubic;
- var curves_17 = curves.easeOutCubic;
- var curves_18 = curves.easeInCubic;
- var curves_19 = curves.easeInOutQuad;
- var curves_20 = curves.easeOutQuad;
- var curves_21 = curves.easeInQuad;
- var curves_22 = curves.easeInOutSine;
- var curves_23 = curves.easeOutSine;
- var curves_24 = curves.easeInSine;
- var curves_25 = curves.linear;
-
- var lib$2 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.transition = transition;
- exports.injectNewCurve = injectNewCurve;
- exports["default"] = void 0;
-
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
-
- var _typeof2 = interopRequireDefault(_typeof_1);
-
- var _curves = interopRequireDefault(curves);
-
- var defaultTransitionBC = 'linear';
- /**
- * @description Get the N-frame animation state by the start and end state
- * of the animation and the easing curve
- * @param {String|Array} tBC Easing curve name or data
- * @param {Number|Array|Object} startState Animation start state
- * @param {Number|Array|Object} endState Animation end state
- * @param {Number} frameNum Number of Animation frames
- * @param {Boolean} deep Whether to use recursive mode
- * @return {Array|Boolean} State of each frame of the animation (Invalid input will return false)
- */
-
- function transition(tBC) {
- var startState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
- var endState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
- var frameNum = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 30;
- var deep = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
- if (!checkParams.apply(void 0, arguments)) return false;
-
- try {
- // Get the transition bezier curve
- var bezierCurve = getBezierCurve(tBC); // Get the progress of each frame state
-
- 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.
-
- if (!deep || typeof endState === 'number') return getTransitionState(startState, endState, frameStateProgress);
- return recursionTransitionState(startState, endState, frameStateProgress);
- } catch (_unused) {
- console.warn('Transition parameter may be abnormal!');
- return [endState];
- }
- }
- /**
- * @description Check if the parameters are legal
- * @param {String} tBC Name of transition bezier curve
- * @param {Any} startState Transition start state
- * @param {Any} endState Transition end state
- * @param {Number} frameNum Number of transition frames
- * @return {Boolean} Is the parameter legal
- */
-
-
- function checkParams(tBC) {
- var startState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var endState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var frameNum = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 30;
-
- if (!tBC || startState === false || endState === false || !frameNum) {
- console.error('transition: Missing Parameters!');
- return false;
- }
-
- if ((0, _typeof2["default"])(startState) !== (0, _typeof2["default"])(endState)) {
- console.error('transition: Inconsistent Status Types!');
- return false;
- }
-
- var stateType = (0, _typeof2["default"])(endState);
-
- if (stateType === 'string' || stateType === 'boolean' || !tBC.length) {
- console.error('transition: Unsupported Data Type of State!');
- return false;
- }
-
- if (!_curves["default"].has(tBC) && !(tBC instanceof Array)) {
- console.warn('transition: Transition curve not found, default curve will be used!');
- }
-
- return true;
- }
- /**
- * @description Get the transition bezier curve
- * @param {String} tBC Name of transition bezier curve
- * @return {Array} Bezier curve data
- */
-
-
- function getBezierCurve(tBC) {
- var bezierCurve = '';
-
- if (_curves["default"].has(tBC)) {
- bezierCurve = _curves["default"].get(tBC);
- } else if (tBC instanceof Array) {
- bezierCurve = tBC;
- } else {
- bezierCurve = _curves["default"].get(defaultTransitionBC);
- }
-
- return bezierCurve;
- }
- /**
- * @description Get the progress of each frame state
- * @param {Array} bezierCurve Transition bezier curve
- * @param {Number} frameNum Number of transition frames
- * @return {Array} Progress of each frame state
- */
-
-
- function getFrameStateProgress(bezierCurve, frameNum) {
- var tMinus = 1 / (frameNum - 1);
- var tState = new Array(frameNum).fill(0).map(function (t, i) {
- return i * tMinus;
- });
- var frameState = tState.map(function (t) {
- return getFrameStateFromT(bezierCurve, t);
- });
- return frameState;
- }
- /**
- * @description Get the progress of the corresponding frame according to t
- * @param {Array} bezierCurve Transition bezier curve
- * @param {Number} t Current frame t
- * @return {Number} Progress of current frame
- */
-
-
- function getFrameStateFromT(bezierCurve, t) {
- var tBezierCurvePoint = getBezierCurvePointFromT(bezierCurve, t);
- var bezierCurvePointT = getBezierCurvePointTFromReT(tBezierCurvePoint, t);
- return getBezierCurveTState(tBezierCurvePoint, bezierCurvePointT);
- }
- /**
- * @description Get the corresponding sub-curve according to t
- * @param {Array} bezierCurve Transition bezier curve
- * @param {Number} t Current frame t
- * @return {Array} Sub-curve of t
- */
-
-
- function getBezierCurvePointFromT(bezierCurve, t) {
- var lastIndex = bezierCurve.length - 1;
- var begin = '',
- end = '';
- bezierCurve.findIndex(function (item, i) {
- if (i === lastIndex) return;
- begin = item;
- end = bezierCurve[i + 1];
- var currentMainPointX = begin[0][0];
- var nextMainPointX = end[0][0];
- return t >= currentMainPointX && t < nextMainPointX;
- });
- var p0 = begin[0];
- var p1 = begin[2] || begin[0];
- var p2 = end[1] || end[0];
- var p3 = end[0];
- return [p0, p1, p2, p3];
- }
- /**
- * @description Get local t based on t and sub-curve
- * @param {Array} bezierCurve Sub-curve
- * @param {Number} t Current frame t
- * @return {Number} local t of sub-curve
- */
-
-
- function getBezierCurvePointTFromReT(bezierCurve, t) {
- var reBeginX = bezierCurve[0][0];
- var reEndX = bezierCurve[3][0];
- var xMinus = reEndX - reBeginX;
- var tMinus = t - reBeginX;
- return tMinus / xMinus;
- }
- /**
- * @description Get the curve progress of t
- * @param {Array} bezierCurve Sub-curve
- * @param {Number} t Current frame t
- * @return {Number} Progress of current frame
- */
-
-
- function getBezierCurveTState(_ref, t) {
- var _ref2 = (0, _slicedToArray2["default"])(_ref, 4),
- _ref2$ = (0, _slicedToArray2["default"])(_ref2[0], 2),
- p0 = _ref2$[1],
- _ref2$2 = (0, _slicedToArray2["default"])(_ref2[1], 2),
- p1 = _ref2$2[1],
- _ref2$3 = (0, _slicedToArray2["default"])(_ref2[2], 2),
- p2 = _ref2$3[1],
- _ref2$4 = (0, _slicedToArray2["default"])(_ref2[3], 2),
- p3 = _ref2$4[1];
-
- var pow = Math.pow;
- var tMinus = 1 - t;
- var result1 = p0 * pow(tMinus, 3);
- var result2 = 3 * p1 * t * pow(tMinus, 2);
- var result3 = 3 * p2 * pow(t, 2) * tMinus;
- var result4 = p3 * pow(t, 3);
- return 1 - (result1 + result2 + result3 + result4);
- }
- /**
- * @description Get transition state according to frame progress
- * @param {Any} startState Transition start state
- * @param {Any} endState Transition end state
- * @param {Array} frameState Frame state progress
- * @return {Array} Transition frame state
- */
-
-
- function getTransitionState(begin, end, frameState) {
- var stateType = 'object';
- if (typeof begin === 'number') stateType = 'number';
- if (begin instanceof Array) stateType = 'array';
- if (stateType === 'number') return getNumberTransitionState(begin, end, frameState);
- if (stateType === 'array') return getArrayTransitionState(begin, end, frameState);
- if (stateType === 'object') return getObjectTransitionState(begin, end, frameState);
- return frameState.map(function (t) {
- return end;
- });
- }
- /**
- * @description Get the transition data of the number type
- * @param {Number} startState Transition start state
- * @param {Number} endState Transition end state
- * @param {Array} frameState Frame state progress
- * @return {Array} Transition frame state
- */
-
-
- function getNumberTransitionState(begin, end, frameState) {
- var minus = end - begin;
- return frameState.map(function (s) {
- return begin + minus * s;
- });
- }
- /**
- * @description Get the transition data of the array type
- * @param {Array} startState Transition start state
- * @param {Array} endState Transition end state
- * @param {Array} frameState Frame state progress
- * @return {Array} Transition frame state
- */
-
-
- function getArrayTransitionState(begin, end, frameState) {
- var minus = end.map(function (v, i) {
- if (typeof v !== 'number') return false;
- return v - begin[i];
- });
- return frameState.map(function (s) {
- return minus.map(function (v, i) {
- if (v === false) return end[i];
- return begin[i] + v * s;
- });
- });
- }
- /**
- * @description Get the transition data of the object type
- * @param {Object} startState Transition start state
- * @param {Object} endState Transition end state
- * @param {Array} frameState Frame state progress
- * @return {Array} Transition frame state
- */
-
-
- function getObjectTransitionState(begin, end, frameState) {
- var keys = Object.keys(end);
- var beginValue = keys.map(function (k) {
- return begin[k];
- });
- var endValue = keys.map(function (k) {
- return end[k];
- });
- var arrayState = getArrayTransitionState(beginValue, endValue, frameState);
- return arrayState.map(function (item) {
- var frameData = {};
- item.forEach(function (v, i) {
- return frameData[keys[i]] = v;
- });
- return frameData;
- });
- }
- /**
- * @description Get the transition state data by recursion
- * @param {Array|Object} startState Transition start state
- * @param {Array|Object} endState Transition end state
- * @param {Array} frameState Frame state progress
- * @return {Array} Transition frame state
- */
-
-
- function recursionTransitionState(begin, end, frameState) {
- var state = getTransitionState(begin, end, frameState);
-
- var _loop = function _loop(key) {
- var bTemp = begin[key];
- var eTemp = end[key];
- if ((0, _typeof2["default"])(eTemp) !== 'object') return "continue";
- var data = recursionTransitionState(bTemp, eTemp, frameState);
- state.forEach(function (fs, i) {
- return fs[key] = data[i];
- });
- };
-
- for (var key in end) {
- var _ret = _loop(key);
-
- if (_ret === "continue") continue;
- }
-
- return state;
- }
- /**
- * @description Inject new curve into curves as config
- * @param {Any} key The key of curve
- * @param {Array} curve Bezier curve data
- * @return {Undefined} No return
- */
-
-
- function injectNewCurve(key, curve) {
- if (!key || !curve) {
- console.error('InjectNewCurve Missing Parameters!');
- return;
- }
-
- _curves["default"].set(key, curve);
- }
-
- var _default = transition;
- exports["default"] = _default;
- });
-
- unwrapExports(lib$2);
- var lib_1$1 = lib$2.transition;
- var lib_2$1 = lib$2.injectNewCurve;
-
- var graph_class = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
-
- var _regenerator = interopRequireDefault(regenerator);
-
- var _asyncToGenerator2 = interopRequireDefault(asyncToGenerator);
-
- var _typeof2 = interopRequireDefault(_typeof_1);
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
- var _classCallCheck2 = interopRequireDefault(classCallCheck);
-
- var _style = interopRequireDefault(style_class);
-
- var _transition = interopRequireDefault(lib$2);
-
-
-
- /**
- * @description Class Graph
- * @param {Object} graph Graph default configuration
- * @param {Object} config Graph config
- * @return {Graph} Instance of Graph
- */
- var Graph = function Graph(graph, config) {
- (0, _classCallCheck2["default"])(this, Graph);
- config = (0, util.deepClone)(config, true);
- var defaultConfig = {
- /**
- * @description Weather to render graph
- * @type {Boolean}
- * @default visible = true
- */
- visible: true,
-
- /**
- * @description Whether to enable drag
- * @type {Boolean}
- * @default drag = false
- */
- drag: false,
-
- /**
- * @description Whether to enable hover
- * @type {Boolean}
- * @default hover = false
- */
- hover: false,
-
- /**
- * @description Graph rendering index
- * Give priority to index high graph in rendering
- * @type {Number}
- * @example index = 1
- */
- index: 1,
-
- /**
- * @description Animation delay time(ms)
- * @type {Number}
- * @default animationDelay = 0
- */
- animationDelay: 0,
-
- /**
- * @description Number of animation frames
- * @type {Number}
- * @default animationFrame = 30
- */
- animationFrame: 30,
-
- /**
- * @description Animation dynamic curve (Supported by transition)
- * @type {String}
- * @default animationCurve = 'linear'
- * @link https://github.com/jiaming743/Transition
- */
- animationCurve: 'linear',
-
- /**
- * @description Weather to pause graph animation
- * @type {Boolean}
- * @default animationPause = false
- */
- animationPause: false,
-
- /**
- * @description Rectangular hover detection zone
- * Use this method for hover detection first
- * @type {Null|Array}
- * @default hoverRect = null
- * @example hoverRect = [0, 0, 100, 100] // [Rect start x, y, Rect width, height]
- */
- hoverRect: null,
-
- /**
- * @description Mouse enter event handler
- * @type {Function|Null}
- * @default mouseEnter = null
- */
- mouseEnter: null,
-
- /**
- * @description Mouse outer event handler
- * @type {Function|Null}
- * @default mouseOuter = null
- */
- mouseOuter: null,
-
- /**
- * @description Mouse click event handler
- * @type {Function|Null}
- * @default click = null
- */
- click: null
- };
- var configAbleNot = {
- status: 'static',
- animationRoot: [],
- animationKeys: [],
- animationFrameState: [],
- cache: {}
- };
- if (!config.shape) config.shape = {};
- if (!config.style) config.style = {};
- var shape = Object.assign({}, graph.shape, config.shape);
- Object.assign(defaultConfig, config, configAbleNot);
- Object.assign(this, graph, defaultConfig);
- this.shape = shape;
- this.style = new _style["default"](config.style);
- this.addedProcessor();
- };
- /**
- * @description Processor of added
- * @return {Undefined} Void
- */
-
-
- exports["default"] = Graph;
-
- Graph.prototype.addedProcessor = function () {
- if (typeof this.setGraphCenter === 'function') this.setGraphCenter(null, this); // The life cycle 'added"
-
- if (typeof this.added === 'function') this.added(this);
- };
- /**
- * @description Processor of draw
- * @param {CRender} render Instance of CRender
- * @param {Graph} graph Instance of Graph
- * @return {Undefined} Void
- */
-
-
- Graph.prototype.drawProcessor = function (render, graph) {
- var ctx = render.ctx;
- graph.style.initStyle(ctx);
- if (typeof this.beforeDraw === 'function') this.beforeDraw(this, render);
- graph.draw(render, graph);
- if (typeof this.drawed === 'function') this.drawed(this, render);
- graph.style.restoreTransform(ctx);
- };
- /**
- * @description Processor of hover check
- * @param {Array} position Mouse Position
- * @param {Graph} graph Instance of Graph
- * @return {Boolean} Result of hover check
- */
-
-
- Graph.prototype.hoverCheckProcessor = function (position, _ref) {
- var hoverRect = _ref.hoverRect,
- style = _ref.style,
- hoverCheck = _ref.hoverCheck;
- var graphCenter = style.graphCenter,
- rotate = style.rotate,
- scale = style.scale,
- translate = style.translate;
-
- if (graphCenter) {
- if (rotate) position = (0, util.getRotatePointPos)(-rotate, position, graphCenter);
- if (scale) position = (0, util.getScalePointPos)(scale.map(function (s) {
- return 1 / s;
- }), position, graphCenter);
- if (translate) position = (0, util.getTranslatePointPos)(translate.map(function (v) {
- return v * -1;
- }), position);
- }
-
- if (hoverRect) return util.checkPointIsInRect.apply(void 0, [position].concat((0, _toConsumableArray2["default"])(hoverRect)));
- return hoverCheck(position, this);
- };
- /**
- * @description Processor of move
- * @param {Event} e Mouse movement event
- * @return {Undefined} Void
- */
-
-
- Graph.prototype.moveProcessor = function (e) {
- this.move(e, this);
- if (typeof this.beforeMove === 'function') this.beforeMove(e, this);
- if (typeof this.setGraphCenter === 'function') this.setGraphCenter(e, this);
- if (typeof this.moved === 'function') this.moved(e, this);
- };
- /**
- * @description Update graph state
- * @param {String} attrName Updated attribute name
- * @param {Any} change Updated value
- * @return {Undefined} Void
- */
-
-
- Graph.prototype.attr = function (attrName) {
- var change = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
- if (!attrName || change === undefined) return false;
- var isObject = (0, _typeof2["default"])(this[attrName]) === 'object';
- if (isObject) change = (0, util.deepClone)(change, true);
- var render = this.render;
-
- if (attrName === 'style') {
- this.style.update(change);
- } else if (isObject) {
- Object.assign(this[attrName], change);
- } else {
- this[attrName] = change;
- }
-
- if (attrName === 'index') render.sortGraphsByIndex();
- render.drawAllGraph();
- };
- /**
- * @description Update graphics state (with animation)
- * Only shape and style attributes are supported
- * @param {String} attrName Updated attribute name
- * @param {Any} change Updated value
- * @param {Boolean} wait Whether to store the animation waiting
- * for the next animation request
- * @return {Promise} Animation Promise
- */
-
-
- Graph.prototype.animation =
- /*#__PURE__*/
- function () {
- var _ref2 = (0, _asyncToGenerator2["default"])(
- /*#__PURE__*/
- _regenerator["default"].mark(function _callee2(attrName, change) {
- var wait,
- changeRoot,
- changeKeys,
- beforeState,
- animationFrame,
- animationCurve,
- animationDelay,
- animationFrameState,
- render,
- _args2 = arguments;
- return _regenerator["default"].wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- wait = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : false;
-
- if (!(attrName !== 'shape' && attrName !== 'style')) {
- _context2.next = 4;
- break;
- }
-
- console.error('Only supported shape and style animation!');
- return _context2.abrupt("return");
-
- case 4:
- change = (0, util.deepClone)(change, true);
- if (attrName === 'style') this.style.colorProcessor(change);
- changeRoot = this[attrName];
- changeKeys = Object.keys(change);
- beforeState = {};
- changeKeys.forEach(function (key) {
- return beforeState[key] = changeRoot[key];
- });
- animationFrame = this.animationFrame, animationCurve = this.animationCurve, animationDelay = this.animationDelay;
- animationFrameState = (0, _transition["default"])(animationCurve, beforeState, change, animationFrame, true);
- this.animationRoot.push(changeRoot);
- this.animationKeys.push(changeKeys);
- this.animationFrameState.push(animationFrameState);
-
- if (!wait) {
- _context2.next = 17;
- break;
- }
-
- return _context2.abrupt("return");
-
- case 17:
- if (!(animationDelay > 0)) {
- _context2.next = 20;
- break;
- }
-
- _context2.next = 20;
- return delay(animationDelay);
-
- case 20:
- render = this.render;
- return _context2.abrupt("return", new Promise(
- /*#__PURE__*/
- function () {
- var _ref3 = (0, _asyncToGenerator2["default"])(
- /*#__PURE__*/
- _regenerator["default"].mark(function _callee(resolve) {
- return _regenerator["default"].wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- _context.next = 2;
- return render.launchAnimation();
-
- case 2:
- resolve();
-
- case 3:
- case "end":
- return _context.stop();
- }
- }
- }, _callee);
- }));
-
- return function (_x3) {
- return _ref3.apply(this, arguments);
- };
- }()));
-
- case 22:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2, this);
- }));
-
- return function (_x, _x2) {
- return _ref2.apply(this, arguments);
- };
- }();
- /**
- * @description Extract the next frame of data from the animation queue
- * and update the graph state
- * @return {Undefined} Void
- */
-
-
- Graph.prototype.turnNextAnimationFrame = function (timeStamp) {
- var animationDelay = this.animationDelay,
- animationRoot = this.animationRoot,
- animationKeys = this.animationKeys,
- animationFrameState = this.animationFrameState,
- animationPause = this.animationPause;
- if (animationPause) return;
- if (Date.now() - timeStamp < animationDelay) return;
- animationRoot.forEach(function (root, i) {
- animationKeys[i].forEach(function (key) {
- root[key] = animationFrameState[i][0][key];
- });
- });
- animationFrameState.forEach(function (stateItem, i) {
- stateItem.shift();
- var noFrame = stateItem.length === 0;
- if (noFrame) animationRoot[i] = null;
- if (noFrame) animationKeys[i] = null;
- });
- this.animationFrameState = animationFrameState.filter(function (state) {
- return state.length;
- });
- this.animationRoot = animationRoot.filter(function (root) {
- return root;
- });
- this.animationKeys = animationKeys.filter(function (keys) {
- return keys;
- });
- };
- /**
- * @description Skip to the last frame of animation
- * @return {Undefined} Void
- */
-
-
- Graph.prototype.animationEnd = function () {
- var animationFrameState = this.animationFrameState,
- animationKeys = this.animationKeys,
- animationRoot = this.animationRoot,
- render = this.render;
- animationRoot.forEach(function (root, i) {
- var currentKeys = animationKeys[i];
- var lastState = animationFrameState[i].pop();
- currentKeys.forEach(function (key) {
- return root[key] = lastState[key];
- });
- });
- this.animationFrameState = [];
- this.animationKeys = [];
- this.animationRoot = [];
- return render.drawAllGraph();
- };
- /**
- * @description Pause animation behavior
- * @return {Undefined} Void
- */
-
-
- Graph.prototype.pauseAnimation = function () {
- this.attr('animationPause', true);
- };
- /**
- * @description Try animation behavior
- * @return {Undefined} Void
- */
-
-
- Graph.prototype.playAnimation = function () {
- var render = this.render;
- this.attr('animationPause', false);
- return new Promise(
- /*#__PURE__*/
- function () {
- var _ref4 = (0, _asyncToGenerator2["default"])(
- /*#__PURE__*/
- _regenerator["default"].mark(function _callee3(resolve) {
- return _regenerator["default"].wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- _context3.next = 2;
- return render.launchAnimation();
-
- case 2:
- resolve();
-
- case 3:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee3);
- }));
-
- return function (_x4) {
- return _ref4.apply(this, arguments);
- };
- }());
- };
- /**
- * @description Processor of delete
- * @param {CRender} render Instance of CRender
- * @return {Undefined} Void
- */
-
-
- Graph.prototype.delProcessor = function (render) {
- var _this = this;
-
- var graphs = render.graphs;
- var index = graphs.findIndex(function (graph) {
- return graph === _this;
- });
- if (index === -1) return;
- if (typeof this.beforeDelete === 'function') this.beforeDelete(this);
- graphs.splice(index, 1, null);
- if (typeof this.deleted === 'function') this.deleted(this);
- };
- /**
- * @description Return a timed release Promise
- * @param {Number} time Release time
- * @return {Promise} A timed release Promise
- */
-
-
- function delay(time) {
- return new Promise(function (resolve) {
- setTimeout(resolve, time);
- });
- }
- });
-
- unwrapExports(graph_class);
-
- var crender_class = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
-
- var _defineProperty2 = interopRequireDefault(defineProperty);
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
- var _classCallCheck2 = interopRequireDefault(classCallCheck);
-
- var _color = interopRequireDefault(lib);
-
- var _bezierCurve = interopRequireDefault(lib$1);
-
-
-
- var _graphs = interopRequireDefault(graphs_1);
-
- var _graph = interopRequireDefault(graph_class);
-
- 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; }
-
- 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; }
-
- /**
- * @description Class of CRender
- * @param {Object} canvas Canvas DOM
- * @return {CRender} Instance of CRender
- */
- var CRender = function CRender(canvas) {
- (0, _classCallCheck2["default"])(this, CRender);
-
- if (!canvas) {
- console.error('CRender Missing parameters!');
- return;
- }
-
- var ctx = canvas.getContext('2d');
- var clientWidth = canvas.clientWidth,
- clientHeight = canvas.clientHeight;
- var area = [clientWidth, clientHeight];
- canvas.setAttribute('width', clientWidth);
- canvas.setAttribute('height', clientHeight);
- /**
- * @description Context of the canvas
- * @type {Object}
- * @example ctx = canvas.getContext('2d')
- */
-
- this.ctx = ctx;
- /**
- * @description Width and height of the canvas
- * @type {Array}
- * @example area = [300,100]
- */
-
- this.area = area;
- /**
- * @description Whether render is in animation rendering
- * @type {Boolean}
- * @example animationStatus = true|false
- */
-
- this.animationStatus = false;
- /**
- * @description Added graph
- * @type {[Graph]}
- * @example graphs = [Graph, Graph, ...]
- */
-
- this.graphs = [];
- /**
- * @description Color plugin
- * @type {Object}
- * @link https://github.com/jiaming743/color
- */
-
- this.color = _color["default"];
- /**
- * @description Bezier Curve plugin
- * @type {Object}
- * @link https://github.com/jiaming743/BezierCurve
- */
-
- this.bezierCurve = _bezierCurve["default"]; // bind event handler
-
- canvas.addEventListener('mousedown', mouseDown.bind(this));
- canvas.addEventListener('mousemove', mouseMove.bind(this));
- canvas.addEventListener('mouseup', mouseUp.bind(this));
- };
- /**
- * @description Clear canvas drawing area
- * @return {Undefined} Void
- */
-
-
- exports["default"] = CRender;
-
- CRender.prototype.clearArea = function () {
- var _this$ctx;
-
- var area = this.area;
-
- (_this$ctx = this.ctx).clearRect.apply(_this$ctx, [0, 0].concat((0, _toConsumableArray2["default"])(area)));
- };
- /**
- * @description Add graph to render
- * @param {Object} config Graph configuration
- * @return {Graph} Graph instance
- */
-
-
- CRender.prototype.add = function () {
- var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var name = config.name;
-
- if (!name) {
- console.error('add Missing parameters!');
- return;
- }
-
- var graphConfig = _graphs["default"].get(name);
-
- if (!graphConfig) {
- console.warn('No corresponding graph configuration found!');
- return;
- }
-
- var graph = new _graph["default"](graphConfig, config);
- if (!graph.validator(graph)) return;
- graph.render = this;
- this.graphs.push(graph);
- this.sortGraphsByIndex();
- this.drawAllGraph();
- return graph;
- };
- /**
- * @description Sort the graph by index
- * @return {Undefined} Void
- */
-
-
- CRender.prototype.sortGraphsByIndex = function () {
- var graphs = this.graphs;
- graphs.sort(function (a, b) {
- if (a.index > b.index) return 1;
- if (a.index === b.index) return 0;
- if (a.index < b.index) return -1;
- });
- };
- /**
- * @description Delete graph in render
- * @param {Graph} graph The graph to be deleted
- * @return {Undefined} Void
- */
-
-
- CRender.prototype.delGraph = function (graph) {
- if (typeof graph.delProcessor !== 'function') return;
- graph.delProcessor(this);
- this.graphs = this.graphs.filter(function (graph) {
- return graph;
- });
- this.drawAllGraph();
- };
- /**
- * @description Delete all graph in render
- * @return {Undefined} Void
- */
-
-
- CRender.prototype.delAllGraph = function () {
- var _this = this;
-
- this.graphs.forEach(function (graph) {
- return graph.delProcessor(_this);
- });
- this.graphs = this.graphs.filter(function (graph) {
- return graph;
- });
- this.drawAllGraph();
- };
- /**
- * @description Draw all the graphs in the render
- * @return {Undefined} Void
- */
-
-
- CRender.prototype.drawAllGraph = function () {
- var _this2 = this;
-
- this.clearArea();
- this.graphs.filter(function (graph) {
- return graph && graph.visible;
- }).forEach(function (graph) {
- return graph.drawProcessor(_this2, graph);
- });
- };
- /**
- * @description Animate the graph whose animation queue is not empty
- * and the animationPause is equal to false
- * @return {Promise} Animation Promise
- */
-
-
- CRender.prototype.launchAnimation = function () {
- var _this3 = this;
-
- var animationStatus = this.animationStatus;
- if (animationStatus) return;
- this.animationStatus = true;
- return new Promise(function (resolve) {
- animation.call(_this3, function () {
- _this3.animationStatus = false;
- resolve();
- }, Date.now());
- });
- };
- /**
- * @description Try to animate every graph
- * @param {Function} callback Callback in animation end
- * @param {Number} timeStamp Time stamp of animation start
- * @return {Undefined} Void
- */
-
-
- function animation(callback, timeStamp) {
- var graphs = this.graphs;
-
- if (!animationAble(graphs)) {
- callback();
- return;
- }
-
- graphs.forEach(function (graph) {
- return graph.turnNextAnimationFrame(timeStamp);
- });
- this.drawAllGraph();
- requestAnimationFrame(animation.bind(this, callback, timeStamp));
- }
- /**
- * @description Find if there are graph that can be animated
- * @param {[Graph]} graphs
- * @return {Boolean}
- */
-
-
- function animationAble(graphs) {
- return graphs.find(function (graph) {
- return !graph.animationPause && graph.animationFrameState.length;
- });
- }
- /**
- * @description Handler of CRender mousedown event
- * @return {Undefined} Void
- */
-
-
- function mouseDown(e) {
- var graphs = this.graphs;
- var hoverGraph = graphs.find(function (graph) {
- return graph.status === 'hover';
- });
- if (!hoverGraph) return;
- hoverGraph.status = 'active';
- }
- /**
- * @description Handler of CRender mousemove event
- * @return {Undefined} Void
- */
-
-
- function mouseMove(e) {
- var offsetX = e.offsetX,
- offsetY = e.offsetY;
- var position = [offsetX, offsetY];
- var graphs = this.graphs;
- var activeGraph = graphs.find(function (graph) {
- return graph.status === 'active' || graph.status === 'drag';
- });
-
- if (activeGraph) {
- if (!activeGraph.drag) return;
-
- if (typeof activeGraph.move !== 'function') {
- console.error('No move method is provided, cannot be dragged!');
- return;
- }
-
- activeGraph.moveProcessor(e);
- activeGraph.status = 'drag';
- return;
- }
-
- var hoverGraph = graphs.find(function (graph) {
- return graph.status === 'hover';
- });
- var hoverAbleGraphs = graphs.filter(function (graph) {
- return graph.hover && (typeof graph.hoverCheck === 'function' || graph.hoverRect);
- });
- var hoveredGraph = hoverAbleGraphs.find(function (graph) {
- return graph.hoverCheckProcessor(position, graph);
- });
-
- if (hoveredGraph) {
- document.body.style.cursor = hoveredGraph.style.hoverCursor;
- } else {
- document.body.style.cursor = 'default';
- }
-
- var hoverGraphMouseOuterIsFun = false,
- hoveredGraphMouseEnterIsFun = false;
- if (hoverGraph) hoverGraphMouseOuterIsFun = typeof hoverGraph.mouseOuter === 'function';
- if (hoveredGraph) hoveredGraphMouseEnterIsFun = typeof hoveredGraph.mouseEnter === 'function';
- if (!hoveredGraph && !hoverGraph) return;
-
- if (!hoveredGraph && hoverGraph) {
- if (hoverGraphMouseOuterIsFun) hoverGraph.mouseOuter(e, hoverGraph);
- hoverGraph.status = 'static';
- return;
- }
-
- if (hoveredGraph && hoveredGraph === hoverGraph) return;
-
- if (hoveredGraph && !hoverGraph) {
- if (hoveredGraphMouseEnterIsFun) hoveredGraph.mouseEnter(e, hoveredGraph);
- hoveredGraph.status = 'hover';
- return;
- }
-
- if (hoveredGraph && hoverGraph && hoveredGraph !== hoverGraph) {
- if (hoverGraphMouseOuterIsFun) hoverGraph.mouseOuter(e, hoverGraph);
- hoverGraph.status = 'static';
- if (hoveredGraphMouseEnterIsFun) hoveredGraph.mouseEnter(e, hoveredGraph);
- hoveredGraph.status = 'hover';
- }
- }
- /**
- * @description Handler of CRender mouseup event
- * @return {Undefined} Void
- */
-
-
- function mouseUp(e) {
- var graphs = this.graphs;
- var activeGraph = graphs.find(function (graph) {
- return graph.status === 'active';
- });
- var dragGraph = graphs.find(function (graph) {
- return graph.status === 'drag';
- });
- if (activeGraph && typeof activeGraph.click === 'function') activeGraph.click(e, activeGraph);
- graphs.forEach(function (graph) {
- return graph && (graph.status = 'static');
- });
- if (activeGraph) activeGraph.status = 'hover';
- if (dragGraph) dragGraph.status = 'hover';
- }
- /**
- * @description Clone Graph
- * @param {Graph} graph The target to be cloned
- * @return {Graph} Cloned graph
- */
-
-
- CRender.prototype.clone = function (graph) {
- var style = graph.style.getStyle();
-
- var clonedGraph = _objectSpread({}, graph, {
- style: style
- });
-
- delete clonedGraph.render;
- clonedGraph = (0, util.deepClone)(clonedGraph, true);
- return this.add(clonedGraph);
- };
- });
-
- unwrapExports(crender_class);
-
- var lib$3 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- Object.defineProperty(exports, "CRender", {
- enumerable: true,
- get: function get() {
- return _crender["default"];
- }
- });
- Object.defineProperty(exports, "extendNewGraph", {
- enumerable: true,
- get: function get() {
- return graphs_1.extendNewGraph;
- }
- });
- exports["default"] = void 0;
-
- var _crender = interopRequireDefault(crender_class);
-
-
-
- var _default = _crender["default"];
- exports["default"] = _default;
- });
-
- var CRender = unwrapExports(lib$3);
-
- var _defineProperty2 = interopRequireDefault(defineProperty);
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
-
-
-
-
-
-
-
-
-
-
- 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; }
-
- 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; }
-
- var pie = {
- shape: {
- rx: 0,
- ry: 0,
- ir: 0,
- or: 0,
- startAngle: 0,
- endAngle: 0,
- clockWise: true
- },
- validator: function validator(_ref) {
- var shape = _ref.shape;
- var keys = ['rx', 'ry', 'ir', 'or', 'startAngle', 'endAngle'];
-
- if (keys.find(function (key) {
- return typeof shape[key] !== 'number';
- })) {
- console.error('Pie shape configuration is abnormal!');
- return false;
- }
-
- return true;
- },
- draw: function draw(_ref2, _ref3) {
- var ctx = _ref2.ctx;
- var shape = _ref3.shape;
- ctx.beginPath();
- var rx = shape.rx,
- ry = shape.ry,
- ir = shape.ir,
- or = shape.or,
- startAngle = shape.startAngle,
- endAngle = shape.endAngle,
- clockWise = shape.clockWise;
- rx = parseInt(rx) + 0.5;
- ry = parseInt(ry) + 0.5;
- ctx.arc(rx, ry, ir > 0 ? ir : 0, startAngle, endAngle, !clockWise);
- var connectPoint1 = (0, util.getCircleRadianPoint)(rx, ry, or, endAngle).map(function (p) {
- return parseInt(p) + 0.5;
- });
- var connectPoint2 = (0, util.getCircleRadianPoint)(rx, ry, ir, startAngle).map(function (p) {
- return parseInt(p) + 0.5;
- });
- ctx.lineTo.apply(ctx, (0, _toConsumableArray2["default"])(connectPoint1));
- ctx.arc(rx, ry, or > 0 ? or : 0, endAngle, startAngle, clockWise);
- ctx.lineTo.apply(ctx, (0, _toConsumableArray2["default"])(connectPoint2));
- ctx.closePath();
- ctx.stroke();
- ctx.fill();
- }
- };
- var agArc = {
- shape: {
- rx: 0,
- ry: 0,
- r: 0,
- startAngle: 0,
- endAngle: 0,
- gradientStartAngle: null,
- gradientEndAngle: null
- },
- validator: function validator(_ref4) {
- var shape = _ref4.shape;
- var keys = ['rx', 'ry', 'r', 'startAngle', 'endAngle'];
-
- if (keys.find(function (key) {
- return typeof shape[key] !== 'number';
- })) {
- console.error('AgArc shape configuration is abnormal!');
- return false;
- }
-
- return true;
- },
- draw: function draw(_ref5, _ref6) {
- var ctx = _ref5.ctx;
- var shape = _ref6.shape,
- style = _ref6.style;
- var gradient = style.gradient;
- gradient = gradient.map(function (cv) {
- return (0, lib.getColorFromRgbValue)(cv);
- });
-
- if (gradient.length === 1) {
- gradient = [gradient[0], gradient[0]];
- }
-
- var gradientArcNum = gradient.length - 1;
- var gradientStartAngle = shape.gradientStartAngle,
- gradientEndAngle = shape.gradientEndAngle,
- startAngle = shape.startAngle,
- endAngle = shape.endAngle,
- r = shape.r,
- rx = shape.rx,
- ry = shape.ry;
- if (gradientStartAngle === null) gradientStartAngle = startAngle;
- if (gradientEndAngle === null) gradientEndAngle = endAngle;
- var angleGap = (gradientEndAngle - gradientStartAngle) / gradientArcNum;
- if (angleGap === Math.PI * 2) angleGap = Math.PI * 2 - 0.001;
-
- for (var i = 0; i < gradientArcNum; i++) {
- ctx.beginPath();
- var startPoint = (0, util.getCircleRadianPoint)(rx, ry, r, startAngle + angleGap * i);
- var endPoint = (0, util.getCircleRadianPoint)(rx, ry, r, startAngle + angleGap * (i + 1));
- var color = (0, util$1.getLinearGradientColor)(ctx, startPoint, endPoint, [gradient[i], gradient[i + 1]]);
- var arcStartAngle = startAngle + angleGap * i;
- var arcEndAngle = startAngle + angleGap * (i + 1);
- var doBreak = false;
-
- if (arcEndAngle > endAngle) {
- arcEndAngle = endAngle;
- doBreak = true;
- }
-
- ctx.arc(rx, ry, r, arcStartAngle, arcEndAngle);
- ctx.strokeStyle = color;
- ctx.stroke();
- if (doBreak) break;
- }
- }
- };
- var numberText = {
- shape: {
- number: [],
- content: '',
- position: [0, 0],
- toFixed: 0,
- rowGap: 0,
- formatter: null
- },
- validator: function validator(_ref7) {
- var shape = _ref7.shape;
- var number = shape.number,
- content = shape.content,
- position = shape.position;
-
- if (!(number instanceof Array) || typeof content !== 'string' || !(position instanceof Array)) {
- console.error('NumberText shape configuration is abnormal!');
- return false;
- }
-
- return true;
- },
- draw: function draw(_ref8, _ref9) {
- var ctx = _ref8.ctx;
- var shape = _ref9.shape;
- var number = shape.number,
- content = shape.content,
- toFixed = shape.toFixed,
- rowGap = shape.rowGap,
- formatter = shape.formatter;
- var textSegments = content.split('{nt}');
- var textString = '';
- textSegments.forEach(function (t, i) {
- var currentNumber = number[i] || '';
-
- if (typeof currentNumber === 'number') {
- currentNumber = currentNumber.toFixed(toFixed);
- if (typeof formatter === 'function') currentNumber = formatter(currentNumber);
- }
-
- textString += t + (currentNumber || '');
- });
-
- graphs_1.text.draw({
- ctx: ctx
- }, {
- shape: _objectSpread({}, shape, {
- content: textString,
- rowGap: rowGap
- })
- });
- }
- };
- var lineIcon = {
- shape: {
- x: 0,
- y: 0,
- w: 0,
- h: 0
- },
- validator: function validator(_ref10) {
- var shape = _ref10.shape;
- var x = shape.x,
- y = shape.y,
- w = shape.w,
- h = shape.h;
-
- if (typeof x !== 'number' || typeof y !== 'number' || typeof w !== 'number' || typeof h !== 'number') {
- console.error('lineIcon shape configuration is abnormal!');
- return false;
- }
-
- return true;
- },
- draw: function draw(_ref11, _ref12) {
- var ctx = _ref11.ctx;
- var shape = _ref12.shape;
- ctx.beginPath();
- var x = shape.x,
- y = shape.y,
- w = shape.w,
- h = shape.h;
- var halfH = h / 2;
- ctx.strokeStyle = ctx.fillStyle;
- ctx.moveTo(x, y + halfH);
- ctx.lineTo(x + w, y + halfH);
- ctx.lineWidth = 1;
- ctx.stroke();
- ctx.beginPath();
- var radius = halfH - 5 * 2;
- if (radius <= 0) radius = 3;
- ctx.arc(x + w / 2, y + halfH, radius, 0, Math.PI * 2);
- ctx.lineWidth = 5;
- ctx.stroke();
- ctx.fillStyle = '#fff';
- ctx.fill();
- },
- hoverCheck: function hoverCheck(position, _ref13) {
- var shape = _ref13.shape;
- var x = shape.x,
- y = shape.y,
- w = shape.w,
- h = shape.h;
- return (0, util.checkPointIsInRect)(position, x, y, w, h);
- },
- setGraphCenter: function setGraphCenter(e, _ref14) {
- var shape = _ref14.shape,
- style = _ref14.style;
- var x = shape.x,
- y = shape.y,
- w = shape.w,
- h = shape.h;
- style.graphCenter = [x + w / 2, y + h / 2];
- }
- };
- (0, lib$3.extendNewGraph)('pie', pie);
- (0, lib$3.extendNewGraph)('agArc', agArc);
- (0, lib$3.extendNewGraph)('numberText', numberText);
- (0, lib$3.extendNewGraph)('lineIcon', lineIcon);
-
- var color = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.colorConfig = void 0;
- var colorConfig = ['#37a2da', '#32c5e9', '#67e0e3', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293', '#e062ae', '#e690d1', '#e7bcf3', '#9d96f5', '#8378ea', '#96bfff'];
- exports.colorConfig = colorConfig;
- });
-
- unwrapExports(color);
- var color_1 = color.colorConfig;
-
- var grid = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.gridConfig = void 0;
- var gridConfig = {
- /**
- * @description Grid left margin
- * @type {String|Number}
- * @default left = '10%'
- * @example left = '10%' | 10
- */
- left: '10%',
-
- /**
- * @description Grid right margin
- * @type {String|Number}
- * @default right = '10%'
- * @example right = '10%' | 10
- */
- right: '10%',
-
- /**
- * @description Grid top margin
- * @type {String|Number}
- * @default top = 60
- * @example top = '10%' | 60
- */
- top: 60,
-
- /**
- * @description Grid bottom margin
- * @type {String|Number}
- * @default bottom = 60
- * @example bottom = '10%' | 60
- */
- bottom: 60,
-
- /**
- * @description Grid default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- fill: 'rgba(0, 0, 0, 0)'
- },
-
- /**
- * @description Grid render level
- * Priority rendering high level
- * @type {Number}
- * @default rLevel = -30
- */
- rLevel: -30,
-
- /**
- * @description Grid animation curve
- * @type {String}
- * @default animationCurve = 'easeOutCubic'
- */
- animationCurve: 'easeOutCubic',
-
- /**
- * @description Grid animation frame
- * @type {Number}
- * @default animationFrame = 50
- */
- animationFrame: 30
- };
- exports.gridConfig = gridConfig;
- });
-
- unwrapExports(grid);
- var grid_1 = grid.gridConfig;
-
- var axis = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.yAxisConfig = exports.xAxisConfig = void 0;
- var xAxisConfig = {
- /**
- * @description Axis name
- * @type {String}
- * @default name = ''
- */
- name: '',
-
- /**
- * @description Whether to display this axis
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Axis position
- * @type {String}
- * @default position = 'bottom'
- * @example position = 'bottom' | 'top'
- */
- position: 'bottom',
-
- /**
- * @description Name gap
- * @type {Number}
- * @default nameGap = 15
- */
- nameGap: 15,
-
- /**
- * @description Name location
- * @type {String}
- * @default nameLocation = 'end'
- * @example nameLocation = 'end' | 'center' | 'start'
- */
- nameLocation: 'end',
-
- /**
- * @description Name default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- nameTextStyle: {
- fill: '#333',
- fontSize: 10
- },
-
- /**
- * @description Axis min value
- * @type {String|Number}
- * @default min = '20%'
- * @example min = '20%' | 0
- */
- min: '20%',
-
- /**
- * @description Axis max value
- * @type {String|Number}
- * @default max = '20%'
- * @example max = '20%' | 0
- */
- max: '20%',
-
- /**
- * @description Axis value interval
- * @type {Number}
- * @default interval = null
- * @example interval = 100
- */
- interval: null,
-
- /**
- * @description Min interval
- * @type {Number}
- * @default minInterval = null
- * @example minInterval = 1
- */
- minInterval: null,
-
- /**
- * @description Max interval
- * @type {Number}
- * @default maxInterval = null
- * @example maxInterval = 100
- */
- maxInterval: null,
-
- /**
- * @description Boundary gap
- * @type {Boolean}
- * @default boundaryGap = null
- * @example boundaryGap = true
- */
- boundaryGap: null,
-
- /**
- * @description Axis split number
- * @type {Number}
- * @default splitNumber = 5
- */
- splitNumber: 5,
-
- /**
- * @description Axis line configuration
- * @type {Object}
- */
- axisLine: {
- /**
- * @description Whether to display axis line
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Axis line default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- stroke: '#333',
- lineWidth: 1
- }
- },
-
- /**
- * @description Axis tick configuration
- * @type {Object}
- */
- axisTick: {
- /**
- * @description Whether to display axis tick
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Axis tick default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- stroke: '#333',
- lineWidth: 1
- }
- },
-
- /**
- * @description Axis label configuration
- * @type {Object}
- */
- axisLabel: {
- /**
- * @description Whether to display axis label
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Axis label formatter
- * @type {String|Function}
- * @default formatter = null
- * @example formatter = '{value}件'
- * @example formatter = (dataItem) => (dataItem.value)
- */
- formatter: null,
-
- /**
- * @description Axis label default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- fill: '#333',
- fontSize: 10,
- rotate: 0
- }
- },
-
- /**
- * @description Axis split line configuration
- * @type {Object}
- */
- splitLine: {
- /**
- * @description Whether to display axis split line
- * @type {Boolean}
- * @default show = false
- */
- show: false,
-
- /**
- * @description Axis split line default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- stroke: '#d4d4d4',
- lineWidth: 1
- }
- },
-
- /**
- * @description X axis render level
- * Priority rendering high level
- * @type {Number}
- * @default rLevel = -20
- */
- rLevel: -20,
-
- /**
- * @description X axis animation curve
- * @type {String}
- * @default animationCurve = 'easeOutCubic'
- */
- animationCurve: 'easeOutCubic',
-
- /**
- * @description X axis animation frame
- * @type {Number}
- * @default animationFrame = 50
- */
- animationFrame: 50
- };
- exports.xAxisConfig = xAxisConfig;
- var yAxisConfig = {
- /**
- * @description Axis name
- * @type {String}
- * @default name = ''
- */
- name: '',
-
- /**
- * @description Whether to display this axis
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Axis position
- * @type {String}
- * @default position = 'left'
- * @example position = 'left' | 'right'
- */
- position: 'left',
-
- /**
- * @description Name gap
- * @type {Number}
- * @default nameGap = 15
- */
- nameGap: 15,
-
- /**
- * @description Name location
- * @type {String}
- * @default nameLocation = 'end'
- * @example nameLocation = 'end' | 'center' | 'start'
- */
- nameLocation: 'end',
-
- /**
- * @description name default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- nameTextStyle: {
- fill: '#333',
- fontSize: 10
- },
-
- /**
- * @description Axis min value
- * @type {String|Number}
- * @default min = '20%'
- * @example min = '20%' | 0
- */
- min: '20%',
-
- /**
- * @description Axis max value
- * @type {String|Number}
- * @default max = '20%'
- * @example max = '20%' | 0
- */
- max: '20%',
-
- /**
- * @description Axis value interval
- * @type {Number}
- * @default interval = null
- * @example interval = 100
- */
- interval: null,
-
- /**
- * @description Min interval
- * @type {Number}
- * @default minInterval = null
- * @example minInterval = 1
- */
- minInterval: null,
-
- /**
- * @description Max interval
- * @type {Number}
- * @default maxInterval = null
- * @example maxInterval = 100
- */
- maxInterval: null,
-
- /**
- * @description Boundary gap
- * @type {Boolean}
- * @default boundaryGap = null
- * @example boundaryGap = true
- */
- boundaryGap: null,
-
- /**
- * @description Axis split number
- * @type {Number}
- * @default splitNumber = 5
- */
- splitNumber: 5,
-
- /**
- * @description Axis line configuration
- * @type {Object}
- */
- axisLine: {
- /**
- * @description Whether to display axis line
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Axis line default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- stroke: '#333',
- lineWidth: 1
- }
- },
-
- /**
- * @description Axis tick configuration
- * @type {Object}
- */
- axisTick: {
- /**
- * @description Whether to display axis tick
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Axis tick default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- stroke: '#333',
- lineWidth: 1
- }
- },
-
- /**
- * @description Axis label configuration
- * @type {Object}
- */
- axisLabel: {
- /**
- * @description Whether to display axis label
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Axis label formatter
- * @type {String|Function}
- * @default formatter = null
- * @example formatter = '{value}件'
- * @example formatter = (dataItem) => (dataItem.value)
- */
- formatter: null,
-
- /**
- * @description Axis label default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- fill: '#333',
- fontSize: 10,
- rotate: 0
- }
- },
-
- /**
- * @description Axis split line configuration
- * @type {Object}
- */
- splitLine: {
- /**
- * @description Whether to display axis split line
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Axis split line default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- stroke: '#d4d4d4',
- lineWidth: 1
- }
- },
-
- /**
- * @description Y axis render level
- * Priority rendering high level
- * @type {Number}
- * @default rLevel = -20
- */
- rLevel: -20,
-
- /**
- * @description Y axis animation curve
- * @type {String}
- * @default animationCurve = 'easeOutCubic'
- */
- animationCurve: 'easeOutCubic',
-
- /**
- * @description Y axis animation frame
- * @type {Number}
- * @default animationFrame = 50
- */
- animationFrame: 50
- };
- exports.yAxisConfig = yAxisConfig;
- });
-
- unwrapExports(axis);
- var axis_1 = axis.yAxisConfig;
- var axis_2 = axis.xAxisConfig;
-
- var title = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.titleConfig = void 0;
- var titleConfig = {
- /**
- * @description Whether to display title
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Title text
- * @type {String}
- * @default text = ''
- */
- text: '',
-
- /**
- * @description Title offset
- * @type {Array}
- * @default offset = [0, -20]
- */
- offset: [0, -20],
-
- /**
- * @description Title default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- fill: '#333',
- fontSize: 17,
- fontWeight: 'bold',
- textAlign: 'center',
- textBaseline: 'bottom'
- },
-
- /**
- * @description Title render level
- * Priority rendering high level
- * @type {Number}
- * @default rLevel = 20
- */
- rLevel: 20,
-
- /**
- * @description Title animation curve
- * @type {String}
- * @default animationCurve = 'easeOutCubic'
- */
- animationCurve: 'easeOutCubic',
-
- /**
- * @description Title animation frame
- * @type {Number}
- * @default animationFrame = 50
- */
- animationFrame: 50
- };
- exports.titleConfig = titleConfig;
- });
-
- unwrapExports(title);
- var title_1 = title.titleConfig;
-
- var line = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.lineConfig = void 0;
- var lineConfig = {
- /**
- * @description Whether to display this line chart
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Legend name
- * @type {String}
- * @default name = ''
- */
- name: '',
-
- /**
- * @description Data stacking
- * The data value of the series element of the same stack
- * will be superimposed (the latter value will be superimposed on the previous value)
- * @type {String}
- * @default stack = ''
- */
- stack: '',
-
- /**
- * @description Smooth line
- * @type {Boolean}
- * @default smooth = false
- */
- smooth: false,
-
- /**
- * @description Line x axis index
- * @type {Number}
- * @default xAxisIndex = 0
- * @example xAxisIndex = 0 | 1
- */
- xAxisIndex: 0,
-
- /**
- * @description Line y axis index
- * @type {Number}
- * @default yAxisIndex = 0
- * @example yAxisIndex = 0 | 1
- */
- yAxisIndex: 0,
-
- /**
- * @description Line chart data
- * @type {Array}
- * @default data = []
- * @example data = [100, 200, 300]
- */
- data: [],
-
- /**
- * @description Line default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- lineStyle: {
- lineWidth: 1
- },
-
- /**
- * @description Line point configuration
- * @type {Object}
- */
- linePoint: {
- /**
- * @description Whether to display line point
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Line point radius
- * @type {Number}
- * @default radius = 2
- */
- radius: 2,
-
- /**
- * @description Line point default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- fill: '#fff',
- lineWidth: 1
- }
- },
-
- /**
- * @description Line area configuration
- * @type {Object}
- */
- lineArea: {
- /**
- * @description Whether to display line area
- * @type {Boolean}
- * @default show = false
- */
- show: false,
-
- /**
- * @description Line area gradient color (Hex|rgb|rgba)
- * @type {Array}
- * @default gradient = []
- */
- gradient: [],
-
- /**
- * @description Line area style default configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- opacity: 0.5
- }
- },
-
- /**
- * @description Line label configuration
- * @type {Object}
- */
- label: {
- /**
- * @description Whether to display line label
- * @type {Boolean}
- * @default show = false
- */
- show: false,
-
- /**
- * @description Line label position
- * @type {String}
- * @default position = 'top'
- * @example position = 'top' | 'center' | 'bottom'
- */
- position: 'top',
-
- /**
- * @description Line label offset
- * @type {Array}
- * @default offset = [0, -10]
- */
- offset: [0, -10],
-
- /**
- * @description Line label formatter
- * @type {String|Function}
- * @default formatter = null
- * @example formatter = '{value}件'
- * @example formatter = (dataItem) => (dataItem.value)
- */
- formatter: null,
-
- /**
- * @description Line label default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- fontSize: 10
- }
- },
-
- /**
- * @description Line chart render level
- * Priority rendering high level
- * @type {Number}
- * @default rLevel = 10
- */
- rLevel: 10,
-
- /**
- * @description Line animation curve
- * @type {String}
- * @default animationCurve = 'easeOutCubic'
- */
- animationCurve: 'easeOutCubic',
-
- /**
- * @description Line animation frame
- * @type {Number}
- * @default animationFrame = 50
- */
- animationFrame: 50
- };
- exports.lineConfig = lineConfig;
- });
-
- unwrapExports(line);
- var line_1 = line.lineConfig;
-
- var bar = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.barConfig = void 0;
- var barConfig = {
- /**
- * @description Whether to display this bar chart
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Legend name
- * @type {String}
- * @default name = ''
- */
- name: '',
-
- /**
- * @description Data stacking
- * The data value of the series element of the same stack
- * will be superimposed (the latter value will be superimposed on the previous value)
- * @type {String}
- * @default stack = ''
- */
- stack: '',
-
- /**
- * @description Bar shape type
- * @type {String}
- * @default shapeType = 'normal'
- * @example shapeType = 'normal' | 'leftEchelon' | 'rightEchelon'
- */
- shapeType: 'normal',
-
- /**
- * @description Echelon bar sharpness offset
- * @type {Number}
- * @default echelonOffset = 10
- */
- echelonOffset: 10,
-
- /**
- * @description Bar width
- * This property should be set on the last 'bar' series
- * in this coordinate system to take effect and will be in effect
- * for all 'bar' series in this coordinate system
- * @type {String|Number}
- * @default barWidth = 'auto'
- * @example barWidth = 'auto' | '10%' | 20
- */
- barWidth: 'auto',
-
- /**
- * @description Bar gap
- * This property should be set on the last 'bar' series
- * in this coordinate system to take effect and will be in effect
- * for all 'bar' series in this coordinate system
- * @type {String|Number}
- * @default barGap = '30%'
- * @example barGap = '30%' | 30
- */
- barGap: '30%',
-
- /**
- * @description Bar category gap
- * This property should be set on the last 'bar' series
- * in this coordinate system to take effect and will be in effect
- * for all 'bar' series in this coordinate system
- * @type {String|Number}
- * @default barCategoryGap = '20%'
- * @example barCategoryGap = '20%' | 20
- */
- barCategoryGap: '20%',
-
- /**
- * @description Bar x axis index
- * @type {Number}
- * @default xAxisIndex = 0
- * @example xAxisIndex = 0 | 1
- */
- xAxisIndex: 0,
-
- /**
- * @description Bar y axis index
- * @type {Number}
- * @default yAxisIndex = 0
- * @example yAxisIndex = 0 | 1
- */
- yAxisIndex: 0,
-
- /**
- * @description Bar chart data
- * @type {Array}
- * @default data = []
- * @example data = [100, 200, 300]
- */
- data: [],
-
- /**
- * @description Background bar configuration
- * @type {Object}
- */
- backgroundBar: {
- /**
- * @description Whether to display background bar
- * @type {Boolean}
- * @default show = false
- */
- show: false,
-
- /**
- * @description Background bar width
- * @type {String|Number}
- * @default width = 'auto'
- * @example width = 'auto' | '30%' | 30
- */
- width: 'auto',
-
- /**
- * @description Background bar default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- fill: 'rgba(200, 200, 200, .4)'
- }
- },
-
- /**
- * @description Bar label configuration
- * @type {Object}
- */
- label: {
- /**
- * @description Whether to display bar label
- * @type {Boolean}
- * @default show = false
- */
- show: false,
-
- /**
- * @description Bar label position
- * @type {String}
- * @default position = 'top'
- * @example position = 'top' | 'center' | 'bottom'
- */
- position: 'top',
-
- /**
- * @description Bar label offset
- * @type {Array}
- * @default offset = [0, -10]
- */
- offset: [0, -10],
-
- /**
- * @description Bar label formatter
- * @type {String|Function}
- * @default formatter = null
- * @example formatter = '{value}件'
- * @example formatter = (dataItem) => (dataItem.value)
- */
- formatter: null,
-
- /**
- * @description Bar label default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- fontSize: 10
- }
- },
-
- /**
- * @description Bar gradient configuration
- * @type {Object}
- */
- gradient: {
- /**
- * @description Gradient color (Hex|rgb|rgba)
- * @type {Array}
- * @default color = []
- */
- color: [],
-
- /**
- * @description Local gradient
- * @type {Boolean}
- * @default local = true
- */
- local: true
- },
-
- /**
- * @description Bar style default configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- barStyle: {},
-
- /**
- * @description Independent color mode
- * When set to true, independent color mode is enabled
- * @type {Boolean}
- * @default independentColor = false
- */
- independentColor: false,
-
- /**
- * @description Independent colors
- * Only effective when independent color mode is enabled
- * Default value is the same as the color in the root configuration
- * Two-dimensional color array can produce gradient colors
- * @type {Array}
- * @example independentColor = ['#fff', '#000']
- * @example independentColor = [['#fff', '#000'], '#000']
- */
- independentColors: [],
-
- /**
- * @description Bar chart render level
- * Priority rendering high level
- * @type {Number}
- * @default rLevel = 0
- */
- rLevel: 0,
-
- /**
- * @description Bar animation curve
- * @type {String}
- * @default animationCurve = 'easeOutCubic'
- */
- animationCurve: 'easeOutCubic',
-
- /**
- * @description Bar animation frame
- * @type {Number}
- * @default animationFrame = 50
- */
- animationFrame: 50
- };
- exports.barConfig = barConfig;
- });
-
- unwrapExports(bar);
- var bar_1 = bar.barConfig;
-
- var pie$1 = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.pieConfig = void 0;
- var pieConfig = {
- /**
- * @description Whether to display this pie chart
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Legend name
- * @type {String}
- * @default name = ''
- */
- name: '',
-
- /**
- * @description Radius of pie
- * @type {String|Number}
- * @default radius = '50%'
- * @example radius = '50%' | 100
- */
- radius: '50%',
-
- /**
- * @description Center point of pie
- * @type {Array}
- * @default center = ['50%','50%']
- * @example center = ['50%','50%'] | [100, 100]
- */
- center: ['50%', '50%'],
-
- /**
- * @description Pie chart start angle
- * @type {Number}
- * @default startAngle = -Math.PI / 2
- * @example startAngle = -Math.PI
- */
- startAngle: -Math.PI / 2,
-
- /**
- * @description Whether to enable rose type
- * @type {Boolean}
- * @default roseType = false
- */
- roseType: false,
-
- /**
- * @description Automatic sorting in rose type
- * @type {Boolean}
- * @default roseSort = true
- */
- roseSort: true,
-
- /**
- * @description Rose radius increasing
- * @type {String|Number}
- * @default roseIncrement = 'auto'
- * @example roseIncrement = 'auto' | '10%' | 10
- */
- roseIncrement: 'auto',
-
- /**
- * @description Pie chart data
- * @type {Array}
- * @default data = []
- */
- data: [],
-
- /**
- * @description Pie inside label configuration
- * @type {Object}
- */
- insideLabel: {
- /**
- * @description Whether to display inside label
- * @type {Boolean}
- * @default show = false
- */
- show: false,
-
- /**
- * @description Label formatter
- * @type {String|Function}
- * @default formatter = '{percent}%'
- * @example formatter = '${name}-{value}-{percent}%'
- * @example formatter = (dataItem) => (dataItem.name)
- */
- formatter: '{percent}%',
-
- /**
- * @description Label default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- fontSize: 10,
- fill: '#fff',
- textAlign: 'center',
- textBaseline: 'middle'
- }
- },
-
- /**
- * @description Pie Outside label configuration
- * @type {Object}
- */
- outsideLabel: {
- /**
- * @description Whether to display outside label
- * @type {Boolean}
- * @default show = false
- */
- show: true,
-
- /**
- * @description Label formatter
- * @type {String|Function}
- * @default formatter = '{name}'
- * @example formatter = '${name}-{value}-{percent}%'
- * @example formatter = (dataItem) => (dataItem.name)
- */
- formatter: '{name}',
-
- /**
- * @description Label default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- fontSize: 11
- },
-
- /**
- * @description Gap beteen label line bended place and pie
- * @type {String|Number}
- * @default labelLineBendGap = '20%'
- * @example labelLineBendGap = '20%' | 20
- */
- labelLineBendGap: '20%',
-
- /**
- * @description Label line end length
- * @type {Number}
- * @default labelLineEndLength = 50
- */
- labelLineEndLength: 50,
-
- /**
- * @description Label line default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- labelLineStyle: {
- lineWidth: 1
- }
- },
-
- /**
- * @description Pie default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- pieStyle: {},
-
- /**
- * @description Percentage fractional precision
- * @type {Number}
- * @default percentToFixed = 0
- */
- percentToFixed: 0,
-
- /**
- * @description Pie chart render level
- * Priority rendering high level
- * @type {Number}
- * @default rLevel = 10
- */
- rLevel: 10,
-
- /**
- * @description Animation delay gap
- * @type {Number}
- * @default animationDelayGap = 60
- */
- animationDelayGap: 60,
-
- /**
- * @description Pie animation curve
- * @type {String}
- * @default animationCurve = 'easeOutCubic'
- */
- animationCurve: 'easeOutCubic',
-
- /**
- * @description Pie start animation curve
- * @type {String}
- * @default startAnimationCurve = 'easeOutBack'
- */
- startAnimationCurve: 'easeOutBack',
-
- /**
- * @description Pie animation frame
- * @type {Number}
- * @default animationFrame = 50
- */
- animationFrame: 50
- };
- exports.pieConfig = pieConfig;
- });
-
- unwrapExports(pie$1);
- var pie_1 = pie$1.pieConfig;
-
- var radarAxis = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.radarAxisConfig = void 0;
- var radarAxisConfig = {
- /**
- * @description Whether to display this radar axis
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Center point of radar axis
- * @type {Array}
- * @default center = ['50%','50%']
- * @example center = ['50%','50%'] | [100, 100]
- */
- center: ['50%', '50%'],
-
- /**
- * @description Radius of radar axis
- * @type {String|Number}
- * @default radius = '65%'
- * @example radius = '65%' | 100
- */
- radius: '65%',
-
- /**
- * @description Radar axis start angle
- * @type {Number}
- * @default startAngle = -Math.PI / 2
- * @example startAngle = -Math.PI
- */
- startAngle: -Math.PI / 2,
-
- /**
- * @description Radar axis split number
- * @type {Number}
- * @default splitNum = 5
- */
- splitNum: 5,
-
- /**
- * @description Whether to enable polygon radar axis
- * @type {Boolean}
- * @default polygon = false
- */
- polygon: false,
-
- /**
- * @description Axis label configuration
- * @type {Object}
- */
- axisLabel: {
- /**
- * @description Whether to display axis label
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Label gap between label and radar axis
- * @type {Number}
- * @default labelGap = 15
- */
- labelGap: 15,
-
- /**
- * @description Label color (Hex|rgb|rgba), will cover style.fill
- * @type {Array}
- * @default color = []
- */
- color: [],
-
- /**
- * @description Axis label default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- fill: '#333'
- }
- },
-
- /**
- * @description Axis line configuration
- * @type {Object}
- */
- axisLine: {
- /**
- * @description Whether to display axis line
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Line color (Hex|rgb|rgba), will cover style.stroke
- * @type {Array}
- * @default color = []
- */
- color: [],
-
- /**
- * @description Axis label default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- stroke: '#999',
- lineWidth: 1
- }
- },
-
- /**
- * @description Split line configuration
- * @type {Object}
- */
- splitLine: {
- /**
- * @description Whether to display split line
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Line color (Hex|rgb|rgba), will cover style.stroke
- * @type {Array}
- * @default color = []
- */
- color: [],
-
- /**
- * @description Split line default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- stroke: '#d4d4d4',
- lineWidth: 1
- }
- },
-
- /**
- * @description Split area configuration
- * @type {Object}
- */
- splitArea: {
- /**
- * @description Whether to display split area
- * @type {Boolean}
- * @default show = false
- */
- show: false,
-
- /**
- * @description Area color (Hex|rgb|rgba), will cover style.stroke
- * @type {Array}
- * @default color = []
- */
- color: ['#f5f5f5', '#e6e6e6'],
-
- /**
- * @description Split area default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {}
- },
-
- /**
- * @description Bar chart render level
- * Priority rendering high level
- * @type {Number}
- * @default rLevel = -10
- */
- rLevel: -10,
-
- /**
- * @description Radar axis animation curve
- * @type {String}
- * @default animationCurve = 'easeOutCubic'
- */
- animationCurve: 'easeOutCubic',
-
- /**
- * @description Radar axis animation frame
- * @type {Number}
- * @default animationFrame = 50
- */
- animationFrane: 50
- };
- exports.radarAxisConfig = radarAxisConfig;
- });
-
- unwrapExports(radarAxis);
- var radarAxis_1 = radarAxis.radarAxisConfig;
-
- var radar = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.radarConfig = void 0;
- var radarConfig = {
- /**
- * @description Whether to display this radar
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Legend name
- * @type {String}
- * @default name = ''
- */
- name: '',
-
- /**
- * @description Radar chart data
- * @type {Array}
- * @default data = []
- * @example data = [100, 200, 300]
- */
- data: [],
-
- /**
- * @description Radar default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- radarStyle: {
- lineWidth: 1
- },
-
- /**
- * @description Radar point configuration
- * @type {Object}
- */
- point: {
- /**
- * @description Whether to display radar point
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Point radius
- * @type {Number}
- * @default radius = 2
- */
- radius: 2,
-
- /**
- * @description Radar point default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- fill: '#fff'
- }
- },
-
- /**
- * @description Radar label configuration
- * @type {Object}
- */
- label: {
- /**
- * @description Whether to display radar label
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Label position offset
- * @type {Array}
- * @default offset = [0, 0]
- */
- offset: [0, 0],
-
- /**
- * @description Label gap between label and radar
- * @type {Number}
- * @default labelGap = 5
- */
- labelGap: 5,
-
- /**
- * @description Label formatter
- * @type {String|Function}
- * @default formatter = null
- * @example formatter = 'Score-{value}'
- * @example formatter = (label) => (label)
- */
- formatter: null,
-
- /**
- * @description Radar label default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- fontSize: 10
- }
- },
-
- /**
- * @description Radar chart render level
- * Priority rendering high level
- * @type {Number}
- * @default rLevel = 10
- */
- rLevel: 10,
-
- /**
- * @description Radar animation curve
- * @type {String}
- * @default animationCurve = 'easeOutCubic'
- */
- animationCurve: 'easeOutCubic',
-
- /**
- * @description Radar animation frame
- * @type {Number}
- * @default animationFrame = 50
- */
- animationFrane: 50
- };
- exports.radarConfig = radarConfig;
- });
-
- unwrapExports(radar);
- var radar_1 = radar.radarConfig;
-
- var gauge = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.gaugeConfig = void 0;
- var gaugeConfig = {
- /**
- * @description Whether to display this gauge
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Legend name
- * @type {String}
- * @default name = ''
- */
- name: '',
-
- /**
- * @description Radius of gauge
- * @type {String|Number}
- * @default radius = '60%'
- * @example radius = '60%' | 100
- */
- radius: '60%',
-
- /**
- * @description Center point of gauge
- * @type {Array}
- * @default center = ['50%','50%']
- * @example center = ['50%','50%'] | [100, 100]
- */
- center: ['50%', '50%'],
-
- /**
- * @description Gauge start angle
- * @type {Number}
- * @default startAngle = -(Math.PI / 4) * 5
- * @example startAngle = -Math.PI
- */
- startAngle: -(Math.PI / 4) * 5,
-
- /**
- * @description Gauge end angle
- * @type {Number}
- * @default endAngle = Math.PI / 4
- * @example endAngle = 0
- */
- endAngle: Math.PI / 4,
-
- /**
- * @description Gauge min value
- * @type {Number}
- * @default min = 0
- */
- min: 0,
-
- /**
- * @description Gauge max value
- * @type {Number}
- * @default max = 100
- */
- max: 100,
-
- /**
- * @description Gauge split number
- * @type {Number}
- * @default splitNum = 5
- */
- splitNum: 5,
-
- /**
- * @description Gauge arc line width
- * @type {Number}
- * @default arcLineWidth = 15
- */
- arcLineWidth: 15,
-
- /**
- * @description Gauge chart data
- * @type {Array}
- * @default data = []
- */
- data: [],
-
- /**
- * @description Data item arc default style configuration
- * @type {Object}
- * @default dataItemStyle = {Configuration Of Class Style}
- */
- dataItemStyle: {},
-
- /**
- * @description Axis tick configuration
- * @type {Object}
- */
- axisTick: {
- /**
- * @description Whether to display axis tick
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Axis tick length
- * @type {Number}
- * @default tickLength = 6
- */
- tickLength: 6,
-
- /**
- * @description Axis tick default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- stroke: '#999',
- lineWidth: 1
- }
- },
-
- /**
- * @description Axis label configuration
- * @type {Object}
- */
- axisLabel: {
- /**
- * @description Whether to display axis label
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Axis label data (Can be calculated automatically)
- * @type {Array}
- * @default data = [Number...]
- */
- data: [],
-
- /**
- * @description Axis label formatter
- * @type {String|Function}
- * @default formatter = null
- * @example formatter = '{value}%'
- * @example formatter = (labelItem) => (labelItem.value)
- */
- formatter: null,
-
- /**
- * @description Axis label gap between label and axis tick
- * @type {String|Function}
- * @default labelGap = 5
- */
- labelGap: 5,
-
- /**
- * @description Axis label default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {}
- },
-
- /**
- * @description Gauge pointer configuration
- * @type {Object}
- */
- pointer: {
- /**
- * @description Whether to display pointer
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Pointer value index of data
- * @type {Number}
- * @default valueIndex = 0 (pointer.value = data[0].value)
- */
- valueIndex: 0,
-
- /**
- * @description Pointer default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- scale: [1, 1],
- fill: '#fb7293'
- }
- },
-
- /**
- * @description Data item arc detail configuration
- * @type {Object}
- */
- details: {
- /**
- * @description Whether to display details
- * @type {Boolean}
- * @default show = false
- */
- show: false,
-
- /**
- * @description Details formatter
- * @type {String|Function}
- * @default formatter = null
- * @example formatter = '{value}%'
- * @example formatter = '{name}%'
- * @example formatter = (dataItem) => (dataItem.value)
- */
- formatter: null,
-
- /**
- * @description Details position offset
- * @type {Array}
- * @default offset = [0, 0]
- * @example offset = [10, 10]
- */
- offset: [0, 0],
-
- /**
- * @description Value fractional precision
- * @type {Number}
- * @default valueToFixed = 0
- */
- valueToFixed: 0,
-
- /**
- * @description Details position
- * @type {String}
- * @default position = 'center'
- * @example position = 'start' | 'center' | 'end'
- */
- position: 'center',
-
- /**
- * @description Details default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- fontSize: 20,
- fontWeight: 'bold',
- textAlign: 'center',
- textBaseline: 'middle'
- }
- },
-
- /**
- * @description Gauge background arc configuration
- * @type {Object}
- */
- backgroundArc: {
- /**
- * @description Whether to display background arc
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Background arc default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- style: {
- stroke: '#e0e0e0'
- }
- },
-
- /**
- * @description Gauge chart render level
- * Priority rendering high level
- * @type {Number}
- * @default rLevel = 10
- */
- rLevel: 10,
-
- /**
- * @description Gauge animation curve
- * @type {String}
- * @default animationCurve = 'easeOutCubic'
- */
- animationCurve: 'easeOutCubic',
-
- /**
- * @description Gauge animation frame
- * @type {Number}
- * @default animationFrame = 50
- */
- animationFrame: 50
- };
- exports.gaugeConfig = gaugeConfig;
- });
-
- unwrapExports(gauge);
- var gauge_1 = gauge.gaugeConfig;
-
- var legend = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.legendConfig = void 0;
- var legendConfig = {
- /**
- * @description Whether to display legend
- * @type {Boolean}
- * @default show = true
- */
- show: true,
-
- /**
- * @description Legend orient
- * @type {String}
- * @default orient = 'horizontal'
- * @example orient = 'horizontal' | 'vertical'
- */
- orient: 'horizontal',
-
- /**
- * @description Legend left
- * @type {String|Number}
- * @default left = 'auto'
- * @example left = 'auto' | '10%' | 10
- */
- left: 'auto',
-
- /**
- * @description Legend right
- * @type {String|Number}
- * @default right = 'auto'
- * @example right = 'auto' | '10%' | 10
- */
- right: 'auto',
-
- /**
- * @description Legend top
- * @type {String|Number}
- * @default top = 'auto'
- * @example top = 'auto' | '10%' | 10
- */
- top: 'auto',
-
- /**
- * @description Legend bottom
- * @type {String|Number}
- * @default bottom = 'auto'
- * @example bottom = 'auto' | '10%' | 10
- */
- bottom: 'auto',
-
- /**
- * @description Legend item gap
- * @type {Number}
- * @default itemGap = 10
- */
- itemGap: 10,
-
- /**
- * @description Icon width
- * @type {Number}
- * @default iconWidth = 25
- */
- iconWidth: 25,
-
- /**
- * @description Icon height
- * @type {Number}
- * @default iconHeight = 10
- */
- iconHeight: 10,
-
- /**
- * @description Whether legend is optional
- * @type {Boolean}
- * @default selectAble = true
- */
- selectAble: true,
-
- /**
- * @description Legend data
- * @type {Array}
- * @default data = []
- */
- data: [],
-
- /**
- * @description Legend text default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- textStyle: {
- fontFamily: 'Arial',
- fontSize: 13,
- fill: '#000'
- },
-
- /**
- * @description Legend icon default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- iconStyle: {},
-
- /**
- * @description Legend text unselected default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- textUnselectedStyle: {
- fontFamily: 'Arial',
- fontSize: 13,
- fill: '#999'
- },
-
- /**
- * @description Legend icon unselected default style configuration
- * @type {Object}
- * @default style = {Configuration Of Class Style}
- */
- iconUnselectedStyle: {
- fill: '#999'
- },
-
- /**
- * @description Legend render level
- * Priority rendering high level
- * @type {Number}
- * @default rLevel = 20
- */
- rLevel: 20,
-
- /**
- * @description Legend animation curve
- * @type {String}
- * @default animationCurve = 'easeOutCubic'
- */
- animationCurve: 'easeOutCubic',
-
- /**
- * @description Legend animation frame
- * @type {Number}
- * @default animationFrame = 50
- */
- animationFrame: 50
- };
- exports.legendConfig = legendConfig;
- });
-
- unwrapExports(legend);
- var legend_1 = legend.legendConfig;
-
- var config = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.changeDefaultConfig = changeDefaultConfig;
- Object.defineProperty(exports, "colorConfig", {
- enumerable: true,
- get: function get() {
- return color.colorConfig;
- }
- });
- Object.defineProperty(exports, "gridConfig", {
- enumerable: true,
- get: function get() {
- return grid.gridConfig;
- }
- });
- Object.defineProperty(exports, "xAxisConfig", {
- enumerable: true,
- get: function get() {
- return axis.xAxisConfig;
- }
- });
- Object.defineProperty(exports, "yAxisConfig", {
- enumerable: true,
- get: function get() {
- return axis.yAxisConfig;
- }
- });
- Object.defineProperty(exports, "titleConfig", {
- enumerable: true,
- get: function get() {
- return title.titleConfig;
- }
- });
- Object.defineProperty(exports, "lineConfig", {
- enumerable: true,
- get: function get() {
- return line.lineConfig;
- }
- });
- Object.defineProperty(exports, "barConfig", {
- enumerable: true,
- get: function get() {
- return bar.barConfig;
- }
- });
- Object.defineProperty(exports, "pieConfig", {
- enumerable: true,
- get: function get() {
- return pie$1.pieConfig;
- }
- });
- Object.defineProperty(exports, "radarAxisConfig", {
- enumerable: true,
- get: function get() {
- return radarAxis.radarAxisConfig;
- }
- });
- Object.defineProperty(exports, "radarConfig", {
- enumerable: true,
- get: function get() {
- return radar.radarConfig;
- }
- });
- Object.defineProperty(exports, "gaugeConfig", {
- enumerable: true,
- get: function get() {
- return gauge.gaugeConfig;
- }
- });
- Object.defineProperty(exports, "legendConfig", {
- enumerable: true,
- get: function get() {
- return legend.legendConfig;
- }
- });
- exports.keys = void 0;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var allConfig = {
- colorConfig: color.colorConfig,
- gridConfig: grid.gridConfig,
- xAxisConfig: axis.xAxisConfig,
- yAxisConfig: axis.yAxisConfig,
- titleConfig: title.titleConfig,
- lineConfig: line.lineConfig,
- barConfig: bar.barConfig,
- pieConfig: pie$1.pieConfig,
- radarAxisConfig: radarAxis.radarAxisConfig,
- radarConfig: radar.radarConfig,
- gaugeConfig: gauge.gaugeConfig,
- legendConfig: legend.legendConfig
- /**
- * @description Change default configuration
- * @param {String} key Configuration key
- * @param {Object|Array} config Your config
- * @return {Undefined} No return
- */
-
- };
-
- function changeDefaultConfig(key, config) {
- if (!allConfig["".concat(key, "Config")]) {
- console.warn('Change default config Error - Invalid key!');
- return;
- }
-
- (0, util$1.deepMerge)(allConfig["".concat(key, "Config")], config);
- }
-
- var keys = ['color', 'title', 'legend', 'xAxis', 'yAxis', 'grid', 'radarAxis', 'line', 'bar', 'pie', 'radar', 'gauge'];
- exports.keys = keys;
- });
-
- unwrapExports(config);
- var config_1 = config.changeDefaultConfig;
- var config_2 = config.keys;
-
- var mergeColor_1 = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.mergeColor = mergeColor;
-
-
-
-
-
-
-
- function mergeColor(chart) {
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var defaultColor = (0, util.deepClone)(config.colorConfig, true);
- var color = option.color,
- series = option.series;
- if (!series) series = [];
- if (!color) color = [];
- option.color = color = (0, util$1.deepMerge)(defaultColor, color);
- if (!series.length) return;
- var colorNum = color.length;
- series.forEach(function (item, i) {
- if (item.color) return;
- item.color = color[i % colorNum];
- });
- var pies = series.filter(function (_ref) {
- var type = _ref.type;
- return type === 'pie';
- });
- pies.forEach(function (pie) {
- return pie.data.forEach(function (di, i) {
- return di.color = color[i % colorNum];
- });
- });
- var gauges = series.filter(function (_ref2) {
- var type = _ref2.type;
- return type === 'gauge';
- });
- gauges.forEach(function (gauge) {
- return gauge.data.forEach(function (di, i) {
- return di.color = color[i % colorNum];
- });
- });
- var barWithIndependentColor = series.filter(function (_ref3) {
- var type = _ref3.type,
- independentColor = _ref3.independentColor;
- return type === 'bar' && independentColor;
- });
- barWithIndependentColor.forEach(function (bar) {
- if (bar.independentColors) return;
- bar.independentColors = color;
- });
- }
- });
-
- unwrapExports(mergeColor_1);
- var mergeColor_2 = mergeColor_1.mergeColor;
-
- var updater_class = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.doUpdate = doUpdate;
- exports.Updater = void 0;
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
- var _typeof2 = interopRequireDefault(_typeof_1);
-
- var _classCallCheck2 = interopRequireDefault(classCallCheck);
-
- var Updater = function Updater(config, series) {
- (0, _classCallCheck2["default"])(this, Updater);
- var chart = config.chart,
- key = config.key,
- getGraphConfig = config.getGraphConfig;
-
- if (typeof getGraphConfig !== 'function') {
- console.warn('Updater need function getGraphConfig!');
- return;
- }
-
- if (!chart[key]) this.graphs = chart[key] = [];
- Object.assign(this, config);
- this.update(series);
- };
-
- exports.Updater = Updater;
-
- Updater.prototype.update = function (series) {
- var _this = this;
-
- var graphs = this.graphs,
- beforeUpdate = this.beforeUpdate;
- delRedundanceGraph(this, series);
- if (!series.length) return;
- var beforeUpdateType = (0, _typeof2["default"])(beforeUpdate);
- series.forEach(function (seriesItem, i) {
- if (beforeUpdateType === 'function') beforeUpdate(graphs, seriesItem, i, _this);
- var cache = graphs[i];
-
- if (cache) {
- changeGraphs(cache, seriesItem, i, _this);
- } else {
- addGraphs(graphs, seriesItem, i, _this);
- }
- });
- };
-
- function delRedundanceGraph(updater, series) {
- var graphs = updater.graphs,
- render = updater.chart.render;
- var cacheGraphNum = graphs.length;
- var needGraphNum = series.length;
-
- if (cacheGraphNum > needGraphNum) {
- var needDelGraphs = graphs.splice(needGraphNum);
- needDelGraphs.forEach(function (item) {
- return item.forEach(function (g) {
- return render.delGraph(g);
- });
- });
- }
- }
-
- function changeGraphs(cache, seriesItem, i, updater) {
- var getGraphConfig = updater.getGraphConfig,
- render = updater.chart.render,
- beforeChange = updater.beforeChange;
- var configs = getGraphConfig(seriesItem, updater);
- balanceGraphsNum(cache, configs, render);
- cache.forEach(function (graph, j) {
- var config = configs[j];
- if (typeof beforeChange === 'function') beforeChange(graph, config);
- updateGraphConfigByKey(graph, config);
- });
- }
-
- function balanceGraphsNum(graphs, graphConfig, render) {
- var cacheGraphNum = graphs.length;
- var needGraphNum = graphConfig.length;
-
- if (needGraphNum > cacheGraphNum) {
- var lastCacheGraph = graphs.slice(-1)[0];
- var needAddGraphNum = needGraphNum - cacheGraphNum;
- var needAddGraphs = new Array(needAddGraphNum).fill(0).map(function (foo) {
- return render.clone(lastCacheGraph);
- });
- graphs.push.apply(graphs, (0, _toConsumableArray2["default"])(needAddGraphs));
- } else if (needGraphNum < cacheGraphNum) {
- var needDelCache = graphs.splice(needGraphNum);
- needDelCache.forEach(function (g) {
- return render.delGraph(g);
- });
- }
- }
-
- function addGraphs(graphs, seriesItem, i, updater) {
- var getGraphConfig = updater.getGraphConfig,
- getStartGraphConfig = updater.getStartGraphConfig,
- chart = updater.chart;
- var render = chart.render;
- var startConfigs = null;
- if (typeof getStartGraphConfig === 'function') startConfigs = getStartGraphConfig(seriesItem, updater);
- var configs = getGraphConfig(seriesItem, updater);
- if (!configs.length) return;
-
- if (startConfigs) {
- graphs[i] = startConfigs.map(function (config) {
- return render.add(config);
- });
- graphs[i].forEach(function (graph, i) {
- var config = configs[i];
- updateGraphConfigByKey(graph, config);
- });
- } else {
- graphs[i] = configs.map(function (config) {
- return render.add(config);
- });
- }
-
- var afterAddGraph = updater.afterAddGraph;
- if (typeof afterAddGraph === 'function') afterAddGraph(graphs[i]);
- }
-
- function updateGraphConfigByKey(graph, config) {
- var keys = Object.keys(config);
- keys.forEach(function (key) {
- if (key === 'shape' || key === 'style') {
- graph.animation(key, config[key], true);
- } else {
- graph[key] = config[key];
- }
- });
- }
-
- function doUpdate() {
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- chart = _ref.chart,
- series = _ref.series,
- key = _ref.key,
- getGraphConfig = _ref.getGraphConfig,
- getStartGraphConfig = _ref.getStartGraphConfig,
- beforeChange = _ref.beforeChange,
- beforeUpdate = _ref.beforeUpdate,
- afterAddGraph = _ref.afterAddGraph;
-
- if (chart[key]) {
- chart[key].update(series);
- } else {
- chart[key] = new Updater({
- chart: chart,
- key: key,
- getGraphConfig: getGraphConfig,
- getStartGraphConfig: getStartGraphConfig,
- beforeChange: beforeChange,
- beforeUpdate: beforeUpdate,
- afterAddGraph: afterAddGraph
- }, series);
- }
- }
- });
-
- unwrapExports(updater_class);
- var updater_class_1 = updater_class.doUpdate;
- var updater_class_2 = updater_class.Updater;
-
- var title_1$1 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.title = title;
-
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
-
-
-
-
-
-
-
-
-
- function title(chart) {
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var title = [];
-
- if (option.title) {
- title[0] = (0, util$1.deepMerge)((0, util.deepClone)(config.titleConfig, true), option.title);
- }
-
- (0, updater_class.doUpdate)({
- chart: chart,
- series: title,
- key: 'title',
- getGraphConfig: getTitleConfig
- });
- }
-
- function getTitleConfig(titleItem, updater) {
- var animationCurve = config.titleConfig.animationCurve,
- animationFrame = config.titleConfig.animationFrame,
- rLevel = config.titleConfig.rLevel;
- var shape = getTitleShape(titleItem, updater);
- var style = getTitleStyle(titleItem);
- return [{
- name: 'text',
- index: rLevel,
- visible: titleItem.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: shape,
- style: style
- }];
- }
-
- function getTitleShape(titleItem, updater) {
- var offset = titleItem.offset,
- text = titleItem.text;
- var _updater$chart$gridAr = updater.chart.gridArea,
- x = _updater$chart$gridAr.x,
- y = _updater$chart$gridAr.y,
- w = _updater$chart$gridAr.w;
-
- var _offset = (0, _slicedToArray2["default"])(offset, 2),
- ox = _offset[0],
- oy = _offset[1];
-
- return {
- content: text,
- position: [x + w / 2 + ox, y + oy]
- };
- }
-
- function getTitleStyle(titleItem) {
- var style = titleItem.style;
- return style;
- }
- });
-
- unwrapExports(title_1$1);
- var title_2 = title_1$1.title;
-
- var grid_1$1 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.grid = grid;
-
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
-
- var _defineProperty2 = interopRequireDefault(defineProperty);
-
-
-
-
-
-
-
-
-
- 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; }
-
- 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; }
-
- function grid(chart) {
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var grid = option.grid;
- grid = (0, util$1.deepMerge)((0, util.deepClone)(config.gridConfig, true), grid || {});
- (0, updater_class.doUpdate)({
- chart: chart,
- series: [grid],
- key: 'grid',
- getGraphConfig: getGridConfig
- });
- }
-
- function getGridConfig(gridItem, updater) {
- var animationCurve = gridItem.animationCurve,
- animationFrame = gridItem.animationFrame,
- rLevel = gridItem.rLevel;
- var shape = getGridShape(gridItem, updater);
- var style = getGridStyle(gridItem);
- updater.chart.gridArea = _objectSpread({}, shape);
- return [{
- name: 'rect',
- index: rLevel,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: shape,
- style: style
- }];
- }
-
- function getGridShape(gridItem, updater) {
- var _updater$chart$render = (0, _slicedToArray2["default"])(updater.chart.render.area, 2),
- w = _updater$chart$render[0],
- h = _updater$chart$render[1];
-
- var left = getNumberValue(gridItem.left, w);
- var right = getNumberValue(gridItem.right, w);
- var top = getNumberValue(gridItem.top, h);
- var bottom = getNumberValue(gridItem.bottom, h);
- var width = w - left - right;
- var height = h - top - bottom;
- return {
- x: left,
- y: top,
- w: width,
- h: height
- };
- }
-
- function getNumberValue(val, all) {
- if (typeof val === 'number') return val;
- if (typeof val !== 'string') return 0;
- return all * parseInt(val) / 100;
- }
-
- function getGridStyle(gridItem) {
- var style = gridItem.style;
- return style;
- }
- });
-
- unwrapExports(grid_1$1);
- var grid_2 = grid_1$1.grid;
-
- var axis_1$1 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.axis = axis;
-
- var _typeof2 = interopRequireDefault(_typeof_1);
-
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
-
- var _defineProperty2 = interopRequireDefault(defineProperty);
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
-
-
-
-
-
-
-
-
- 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; }
-
- 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; }
-
- var axisConfig = {
- xAxisConfig: config.xAxisConfig,
- yAxisConfig: config.yAxisConfig
- };
- var abs = Math.abs,
- pow = Math.pow;
-
- function axis(chart) {
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var xAxis = option.xAxis,
- yAxis = option.yAxis,
- series = option.series;
- var allAxis = [];
-
- if (xAxis && yAxis && series) {
- allAxis = getAllAxis(xAxis, yAxis);
- allAxis = mergeDefaultAxisConfig(allAxis);
- allAxis = allAxis.filter(function (_ref) {
- var show = _ref.show;
- return show;
- });
- allAxis = mergeDefaultBoundaryGap(allAxis);
- allAxis = calcAxisLabelData(allAxis, series);
- allAxis = setAxisPosition(allAxis);
- allAxis = calcAxisLinePosition(allAxis, chart);
- allAxis = calcAxisTickPosition(allAxis);
- allAxis = calcAxisNamePosition(allAxis);
- allAxis = calcSplitLinePosition(allAxis, chart);
- }
-
- (0, updater_class.doUpdate)({
- chart: chart,
- series: allAxis,
- key: 'axisLine',
- getGraphConfig: getLineConfig
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: allAxis,
- key: 'axisTick',
- getGraphConfig: getTickConfig
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: allAxis,
- key: 'axisLabel',
- getGraphConfig: getLabelConfig
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: allAxis,
- key: 'axisName',
- getGraphConfig: getNameConfig
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: allAxis,
- key: 'splitLine',
- getGraphConfig: getSplitLineConfig
- });
- chart.axisData = allAxis;
- }
-
- function getAllAxis(xAxis, yAxis) {
- var allXAxis = [],
- allYAxis = [];
-
- if (xAxis instanceof Array) {
- var _allXAxis;
-
- (_allXAxis = allXAxis).push.apply(_allXAxis, (0, _toConsumableArray2["default"])(xAxis));
- } else {
- allXAxis.push(xAxis);
- }
-
- if (yAxis instanceof Array) {
- var _allYAxis;
-
- (_allYAxis = allYAxis).push.apply(_allYAxis, (0, _toConsumableArray2["default"])(yAxis));
- } else {
- allYAxis.push(yAxis);
- }
-
- allXAxis.splice(2);
- allYAxis.splice(2);
- allXAxis = allXAxis.map(function (axis, i) {
- return _objectSpread({}, axis, {
- index: i,
- axis: 'x'
- });
- });
- allYAxis = allYAxis.map(function (axis, i) {
- return _objectSpread({}, axis, {
- index: i,
- axis: 'y'
- });
- });
- return [].concat((0, _toConsumableArray2["default"])(allXAxis), (0, _toConsumableArray2["default"])(allYAxis));
- }
-
- function mergeDefaultAxisConfig(allAxis) {
- var xAxis = allAxis.filter(function (_ref2) {
- var axis = _ref2.axis;
- return axis === 'x';
- });
- var yAxis = allAxis.filter(function (_ref3) {
- var axis = _ref3.axis;
- return axis === 'y';
- });
- xAxis = xAxis.map(function (axis) {
- return (0, util$1.deepMerge)((0, util.deepClone)(config.xAxisConfig), axis);
- });
- yAxis = yAxis.map(function (axis) {
- return (0, util$1.deepMerge)((0, util.deepClone)(config.yAxisConfig), axis);
- });
- return [].concat((0, _toConsumableArray2["default"])(xAxis), (0, _toConsumableArray2["default"])(yAxis));
- }
-
- function mergeDefaultBoundaryGap(allAxis) {
- var valueAxis = allAxis.filter(function (_ref4) {
- var data = _ref4.data;
- return data === 'value';
- });
- var labelAxis = allAxis.filter(function (_ref5) {
- var data = _ref5.data;
- return data !== 'value';
- });
- valueAxis.forEach(function (axis) {
- if (typeof axis.boundaryGap === 'boolean') return;
- axis.boundaryGap = false;
- });
- labelAxis.forEach(function (axis) {
- if (typeof axis.boundaryGap === 'boolean') return;
- axis.boundaryGap = true;
- });
- return [].concat((0, _toConsumableArray2["default"])(valueAxis), (0, _toConsumableArray2["default"])(labelAxis));
- }
-
- function calcAxisLabelData(allAxis, series) {
- var valueAxis = allAxis.filter(function (_ref6) {
- var data = _ref6.data;
- return data === 'value';
- });
- var labelAxis = allAxis.filter(function (_ref7) {
- var data = _ref7.data;
- return data instanceof Array;
- });
- valueAxis = calcValueAxisLabelData(valueAxis, series);
- labelAxis = calcLabelAxisLabelData(labelAxis);
- return [].concat((0, _toConsumableArray2["default"])(valueAxis), (0, _toConsumableArray2["default"])(labelAxis));
- }
-
- function calcValueAxisLabelData(valueAxis, series) {
- return valueAxis.map(function (axis) {
- var minMaxValue = getValueAxisMaxMinValue(axis, series);
-
- var _getTrueMinMax = getTrueMinMax(axis, minMaxValue),
- _getTrueMinMax2 = (0, _slicedToArray2["default"])(_getTrueMinMax, 2),
- min = _getTrueMinMax2[0],
- max = _getTrueMinMax2[1];
-
- var interval = getValueInterval(min, max, axis);
- var formatter = axis.axisLabel.formatter;
- var label = [];
-
- if (min < 0 && max > 0) {
- label = getValueAxisLabelFromZero(min, max, interval);
- } else {
- label = getValueAxisLabelFromMin(min, max, interval);
- }
-
- label = label.map(function (l) {
- return parseFloat(l.toFixed(2));
- });
- return _objectSpread({}, axis, {
- maxValue: label.slice(-1)[0],
- minValue: label[0],
- label: getAfterFormatterLabel(label, formatter)
- });
- });
- }
-
- function getValueAxisMaxMinValue(axis, series) {
- series = series.filter(function (_ref8) {
- var show = _ref8.show,
- type = _ref8.type;
- if (show === false) return false;
- if (type === 'pie') return false;
- return true;
- });
- if (series.length === 0) return [0, 0];
- var index = axis.index,
- axisType = axis.axis;
- series = mergeStackData(series);
- var axisName = axisType + 'Axis';
- var valueSeries = series.filter(function (s) {
- return s[axisName] === index;
- });
- if (!valueSeries.length) valueSeries = series;
- return getSeriesMinMaxValue(valueSeries);
- }
-
- function getSeriesMinMaxValue(series) {
- if (!series) return;
- var minValue = Math.min.apply(Math, (0, _toConsumableArray2["default"])(series.map(function (_ref9) {
- var data = _ref9.data;
- return Math.min.apply(Math, (0, _toConsumableArray2["default"])((0, util$1.filterNonNumber)(data)));
- })));
- var maxValue = Math.max.apply(Math, (0, _toConsumableArray2["default"])(series.map(function (_ref10) {
- var data = _ref10.data;
- return Math.max.apply(Math, (0, _toConsumableArray2["default"])((0, util$1.filterNonNumber)(data)));
- })));
- return [minValue, maxValue];
- }
-
- function mergeStackData(series) {
- var seriesCloned = (0, util.deepClone)(series, true);
- series.forEach(function (item, i) {
- var data = (0, util$1.mergeSameStackData)(item, series);
- seriesCloned[i].data = data;
- });
- return seriesCloned;
- }
-
- function getTrueMinMax(_ref11, _ref12) {
- var min = _ref11.min,
- max = _ref11.max,
- axis = _ref11.axis;
-
- var _ref13 = (0, _slicedToArray2["default"])(_ref12, 2),
- minValue = _ref13[0],
- maxValue = _ref13[1];
-
- var minType = (0, _typeof2["default"])(min),
- maxType = (0, _typeof2["default"])(max);
-
- if (!testMinMaxType(min)) {
- min = axisConfig[axis + 'AxisConfig'].min;
- minType = 'string';
- }
-
- if (!testMinMaxType(max)) {
- max = axisConfig[axis + 'AxisConfig'].max;
- maxType = 'string';
- }
-
- if (minType === 'string') {
- min = parseInt(minValue - abs(minValue * parseFloat(min) / 100));
- var lever = getValueLever(min);
- min = parseFloat((min / lever - 0.1).toFixed(1)) * lever;
- }
-
- if (maxType === 'string') {
- max = parseInt(maxValue + abs(maxValue * parseFloat(max) / 100));
-
- var _lever = getValueLever(max);
-
- max = parseFloat((max / _lever + 0.1).toFixed(1)) * _lever;
- }
-
- return [min, max];
- }
-
- function getValueLever(value) {
- var valueString = abs(value).toString();
- var valueLength = valueString.length;
- var firstZeroIndex = valueString.replace(/0*$/g, '').indexOf('0');
- var pow10Num = valueLength - 1;
- if (firstZeroIndex !== -1) pow10Num -= firstZeroIndex;
- return pow(10, pow10Num);
- }
-
- function testMinMaxType(val) {
- var valType = (0, _typeof2["default"])(val);
- var isValidString = valType === 'string' && /^\d+%$/.test(val);
- var isValidNumber = valType === 'number';
- return isValidString || isValidNumber;
- }
-
- function getValueAxisLabelFromZero(min, max, interval) {
- var negative = [],
- positive = [];
- var currentNegative = 0,
- currentPositive = 0;
-
- do {
- negative.push(currentNegative -= interval);
- } while (currentNegative > min);
-
- do {
- positive.push(currentPositive += interval);
- } while (currentPositive < max);
-
- return [].concat((0, _toConsumableArray2["default"])(negative.reverse()), [0], (0, _toConsumableArray2["default"])(positive));
- }
-
- function getValueAxisLabelFromMin(min, max, interval) {
- var label = [min],
- currentValue = min;
-
- do {
- label.push(currentValue += interval);
- } while (currentValue < max);
-
- return label;
- }
-
- function getAfterFormatterLabel(label, formatter) {
- if (!formatter) return label;
- if (typeof formatter === 'string') label = label.map(function (l) {
- return formatter.replace('{value}', l);
- });
- if (typeof formatter === 'function') label = label.map(function (value, index) {
- return formatter({
- value: value,
- index: index
- });
- });
- return label;
- }
-
- function calcLabelAxisLabelData(labelAxis) {
- return labelAxis.map(function (axis) {
- var data = axis.data,
- formatter = axis.axisLabel.formatter;
- return _objectSpread({}, axis, {
- label: getAfterFormatterLabel(data, formatter)
- });
- });
- }
-
- function getValueInterval(min, max, axis) {
- var interval = axis.interval,
- minInterval = axis.minInterval,
- maxInterval = axis.maxInterval,
- splitNumber = axis.splitNumber,
- axisType = axis.axis;
- var config = axisConfig[axisType + 'AxisConfig'];
- if (typeof interval !== 'number') interval = config.interval;
- if (typeof minInterval !== 'number') minInterval = config.minInterval;
- if (typeof maxInterval !== 'number') maxInterval = config.maxInterval;
- if (typeof splitNumber !== 'number') splitNumber = config.splitNumber;
- if (typeof interval === 'number') return interval;
- var valueInterval = parseInt((max - min) / (splitNumber - 1));
- if (valueInterval.toString().length > 1) valueInterval = parseInt(valueInterval.toString().replace(/\d$/, '0'));
- if (valueInterval === 0) valueInterval = 1;
- if (typeof minInterval === 'number' && valueInterval < minInterval) return minInterval;
- if (typeof maxInterval === 'number' && valueInterval > maxInterval) return maxInterval;
- return valueInterval;
- }
-
- function setAxisPosition(allAxis) {
- var xAxis = allAxis.filter(function (_ref14) {
- var axis = _ref14.axis;
- return axis === 'x';
- });
- var yAxis = allAxis.filter(function (_ref15) {
- var axis = _ref15.axis;
- return axis === 'y';
- });
- if (xAxis[0] && !xAxis[0].position) xAxis[0].position = config.xAxisConfig.position;
-
- if (xAxis[1] && !xAxis[1].position) {
- xAxis[1].position = xAxis[0].position === 'bottom' ? 'top' : 'bottom';
- }
-
- if (yAxis[0] && !yAxis[0].position) yAxis[0].position = config.yAxisConfig.position;
-
- if (yAxis[1] && !yAxis[1].position) {
- yAxis[1].position = yAxis[0].position === 'left' ? 'right' : 'left';
- }
-
- return [].concat((0, _toConsumableArray2["default"])(xAxis), (0, _toConsumableArray2["default"])(yAxis));
- }
-
- function calcAxisLinePosition(allAxis, chart) {
- var _chart$gridArea = chart.gridArea,
- x = _chart$gridArea.x,
- y = _chart$gridArea.y,
- w = _chart$gridArea.w,
- h = _chart$gridArea.h;
- allAxis = allAxis.map(function (axis) {
- var position = axis.position;
- var linePosition = [];
-
- if (position === 'left') {
- linePosition = [[x, y], [x, y + h]].reverse();
- } else if (position === 'right') {
- linePosition = [[x + w, y], [x + w, y + h]].reverse();
- } else if (position === 'top') {
- linePosition = [[x, y], [x + w, y]];
- } else if (position === 'bottom') {
- linePosition = [[x, y + h], [x + w, y + h]];
- }
-
- return _objectSpread({}, axis, {
- linePosition: linePosition
- });
- });
- return allAxis;
- }
-
- function calcAxisTickPosition(allAxis, chart) {
- return allAxis.map(function (axisItem) {
- var axis = axisItem.axis,
- linePosition = axisItem.linePosition,
- position = axisItem.position,
- label = axisItem.label,
- boundaryGap = axisItem.boundaryGap;
- if (typeof boundaryGap !== 'boolean') boundaryGap = axisConfig[axis + 'AxisConfig'].boundaryGap;
- var labelNum = label.length;
-
- var _linePosition = (0, _slicedToArray2["default"])(linePosition, 2),
- _linePosition$ = (0, _slicedToArray2["default"])(_linePosition[0], 2),
- startX = _linePosition$[0],
- startY = _linePosition$[1],
- _linePosition$2 = (0, _slicedToArray2["default"])(_linePosition[1], 2),
- endX = _linePosition$2[0],
- endY = _linePosition$2[1];
-
- var gapLength = axis === 'x' ? endX - startX : endY - startY;
- var gap = gapLength / (boundaryGap ? labelNum : labelNum - 1);
- var tickPosition = new Array(labelNum).fill(0).map(function (foo, i) {
- if (axis === 'x') {
- return [startX + gap * (boundaryGap ? i + 0.5 : i), startY];
- }
-
- return [startX, startY + gap * (boundaryGap ? i + 0.5 : i)];
- });
- var tickLinePosition = getTickLinePosition(axis, boundaryGap, position, tickPosition, gap);
- return _objectSpread({}, axisItem, {
- tickPosition: tickPosition,
- tickLinePosition: tickLinePosition,
- tickGap: gap
- });
- });
- }
-
- function getTickLinePosition(axisType, boundaryGap, position, tickPosition, gap) {
- var index = axisType === 'x' ? 1 : 0;
- var plus = 5;
- if (axisType === 'x' && position === 'top') plus = -5;
- if (axisType === 'y' && position === 'left') plus = -5;
- var tickLinePosition = tickPosition.map(function (lineStart) {
- var lineEnd = (0, util.deepClone)(lineStart);
- lineEnd[index] += plus;
- return [(0, util.deepClone)(lineStart), lineEnd];
- });
- if (!boundaryGap) return tickLinePosition;
- index = axisType === 'x' ? 0 : 1;
- plus = gap / 2;
- tickLinePosition.forEach(function (_ref16) {
- var _ref17 = (0, _slicedToArray2["default"])(_ref16, 2),
- lineStart = _ref17[0],
- lineEnd = _ref17[1];
-
- lineStart[index] += plus;
- lineEnd[index] += plus;
- });
- return tickLinePosition;
- }
-
- function calcAxisNamePosition(allAxis, chart) {
- return allAxis.map(function (axisItem) {
- var nameGap = axisItem.nameGap,
- nameLocation = axisItem.nameLocation,
- position = axisItem.position,
- linePosition = axisItem.linePosition;
-
- var _linePosition2 = (0, _slicedToArray2["default"])(linePosition, 2),
- lineStart = _linePosition2[0],
- lineEnd = _linePosition2[1];
-
- var namePosition = (0, _toConsumableArray2["default"])(lineStart);
- if (nameLocation === 'end') namePosition = (0, _toConsumableArray2["default"])(lineEnd);
-
- if (nameLocation === 'center') {
- namePosition[0] = (lineStart[0] + lineEnd[0]) / 2;
- namePosition[1] = (lineStart[1] + lineEnd[1]) / 2;
- }
-
- var index = 0;
- if (position === 'top' && nameLocation === 'center') index = 1;
- if (position === 'bottom' && nameLocation === 'center') index = 1;
- if (position === 'left' && nameLocation !== 'center') index = 1;
- if (position === 'right' && nameLocation !== 'center') index = 1;
- var plus = nameGap;
- if (position === 'top' && nameLocation !== 'end') plus *= -1;
- if (position === 'left' && nameLocation !== 'start') plus *= -1;
- if (position === 'bottom' && nameLocation === 'start') plus *= -1;
- if (position === 'right' && nameLocation === 'end') plus *= -1;
- namePosition[index] += plus;
- return _objectSpread({}, axisItem, {
- namePosition: namePosition
- });
- });
- }
-
- function calcSplitLinePosition(allAxis, chart) {
- var _chart$gridArea2 = chart.gridArea,
- w = _chart$gridArea2.w,
- h = _chart$gridArea2.h;
- return allAxis.map(function (axisItem) {
- var tickLinePosition = axisItem.tickLinePosition,
- position = axisItem.position,
- boundaryGap = axisItem.boundaryGap;
- var index = 0,
- plus = w;
- if (position === 'top' || position === 'bottom') index = 1;
- if (position === 'top' || position === 'bottom') plus = h;
- if (position === 'right' || position === 'bottom') plus *= -1;
- var splitLinePosition = tickLinePosition.map(function (_ref18) {
- var _ref19 = (0, _slicedToArray2["default"])(_ref18, 1),
- startPoint = _ref19[0];
-
- var endPoint = (0, _toConsumableArray2["default"])(startPoint);
- endPoint[index] += plus;
- return [(0, _toConsumableArray2["default"])(startPoint), endPoint];
- });
- if (!boundaryGap) splitLinePosition.shift();
- return _objectSpread({}, axisItem, {
- splitLinePosition: splitLinePosition
- });
- });
- }
-
- function getLineConfig(axisItem) {
- var animationCurve = axisItem.animationCurve,
- animationFrame = axisItem.animationFrame,
- rLevel = axisItem.rLevel;
- return [{
- name: 'polyline',
- index: rLevel,
- visible: axisItem.axisLine.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getLineShape(axisItem),
- style: getLineStyle(axisItem)
- }];
- }
-
- function getLineShape(axisItem) {
- var linePosition = axisItem.linePosition;
- return {
- points: linePosition
- };
- }
-
- function getLineStyle(axisItem) {
- return axisItem.axisLine.style;
- }
-
- function getTickConfig(axisItem) {
- var animationCurve = axisItem.animationCurve,
- animationFrame = axisItem.animationFrame,
- rLevel = axisItem.rLevel;
- var shapes = getTickShapes(axisItem);
- var style = getTickStyle(axisItem);
- return shapes.map(function (shape) {
- return {
- name: 'polyline',
- index: rLevel,
- visible: axisItem.axisTick.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: shape,
- style: style
- };
- });
- }
-
- function getTickShapes(axisItem) {
- var tickLinePosition = axisItem.tickLinePosition;
- return tickLinePosition.map(function (points) {
- return {
- points: points
- };
- });
- }
-
- function getTickStyle(axisItem) {
- return axisItem.axisTick.style;
- }
-
- function getLabelConfig(axisItem) {
- var animationCurve = axisItem.animationCurve,
- animationFrame = axisItem.animationFrame,
- rLevel = axisItem.rLevel;
- var shapes = getLabelShapes(axisItem);
- var styles = getLabelStyle(axisItem, shapes);
- return shapes.map(function (shape, i) {
- return {
- name: 'text',
- index: rLevel,
- visible: axisItem.axisLabel.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: shape,
- style: styles[i],
- setGraphCenter: function setGraphCenter() {
- return void 0;
- }
- };
- });
- }
-
- function getLabelShapes(axisItem) {
- var label = axisItem.label,
- tickPosition = axisItem.tickPosition,
- position = axisItem.position;
- return tickPosition.map(function (point, i) {
- return {
- position: getLabelRealPosition(point, position),
- content: label[i].toString()
- };
- });
- }
-
- function getLabelRealPosition(points, position) {
- var index = 0,
- plus = 10;
- if (position === 'top' || position === 'bottom') index = 1;
- if (position === 'top' || position === 'left') plus = -10;
- points = (0, util.deepClone)(points);
- points[index] += plus;
- return points;
- }
-
- function getLabelStyle(axisItem, shapes) {
- var position = axisItem.position;
- var style = axisItem.axisLabel.style;
- var align = getAxisLabelRealAlign(position);
- style = (0, util$1.deepMerge)(align, style);
- var styles = shapes.map(function (_ref20) {
- var position = _ref20.position;
- return _objectSpread({}, style, {
- graphCenter: position
- });
- });
- return styles;
- }
-
- function getAxisLabelRealAlign(position) {
- if (position === 'left') return {
- textAlign: 'right',
- textBaseline: 'middle'
- };
- if (position === 'right') return {
- textAlign: 'left',
- textBaseline: 'middle'
- };
- if (position === 'top') return {
- textAlign: 'center',
- textBaseline: 'bottom'
- };
- if (position === 'bottom') return {
- textAlign: 'center',
- textBaseline: 'top'
- };
- }
-
- function getNameConfig(axisItem) {
- var animationCurve = axisItem.animationCurve,
- animationFrame = axisItem.animationFrame,
- rLevel = axisItem.rLevel;
- return [{
- name: 'text',
- index: rLevel,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getNameShape(axisItem),
- style: getNameStyle(axisItem)
- }];
- }
-
- function getNameShape(axisItem) {
- var name = axisItem.name,
- namePosition = axisItem.namePosition;
- return {
- content: name,
- position: namePosition
- };
- }
-
- function getNameStyle(axisItem) {
- var nameLocation = axisItem.nameLocation,
- position = axisItem.position,
- style = axisItem.nameTextStyle;
- var align = getNameRealAlign(position, nameLocation);
- return (0, util$1.deepMerge)(align, style);
- }
-
- function getNameRealAlign(position, location) {
- if (position === 'top' && location === 'start' || position === 'bottom' && location === 'start' || position === 'left' && location === 'center') return {
- textAlign: 'right',
- textBaseline: 'middle'
- };
- if (position === 'top' && location === 'end' || position === 'bottom' && location === 'end' || position === 'right' && location === 'center') return {
- textAlign: 'left',
- textBaseline: 'middle'
- };
- if (position === 'top' && location === 'center' || position === 'left' && location === 'end' || position === 'right' && location === 'end') return {
- textAlign: 'center',
- textBaseline: 'bottom'
- };
- if (position === 'bottom' && location === 'center' || position === 'left' && location === 'start' || position === 'right' && location === 'start') return {
- textAlign: 'center',
- textBaseline: 'top'
- };
- }
-
- function getSplitLineConfig(axisItem) {
- var animationCurve = axisItem.animationCurve,
- animationFrame = axisItem.animationFrame,
- rLevel = axisItem.rLevel;
- var shapes = getSplitLineShapes(axisItem);
- var style = getSplitLineStyle(axisItem);
- return shapes.map(function (shape) {
- return {
- name: 'polyline',
- index: rLevel,
- visible: axisItem.splitLine.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: shape,
- style: style
- };
- });
- }
-
- function getSplitLineShapes(axisItem) {
- var splitLinePosition = axisItem.splitLinePosition;
- return splitLinePosition.map(function (points) {
- return {
- points: points
- };
- });
- }
-
- function getSplitLineStyle(axisItem) {
- return axisItem.splitLine.style;
- }
- });
-
- unwrapExports(axis_1$1);
- var axis_2$1 = axis_1$1.axis;
-
- var line_1$1 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.line = line;
-
- var _typeof2 = interopRequireDefault(_typeof_1);
-
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
- var _defineProperty2 = interopRequireDefault(defineProperty);
-
-
-
-
-
- var _bezierCurve = interopRequireDefault(lib$1);
-
-
-
- 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; }
-
- 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; }
-
- var polylineToBezierCurve = _bezierCurve["default"].polylineToBezierCurve,
- getBezierCurveLength = _bezierCurve["default"].getBezierCurveLength;
-
- function line(chart) {
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var xAxis = option.xAxis,
- yAxis = option.yAxis,
- series = option.series;
- var lines = [];
-
- if (xAxis && yAxis && series) {
- lines = (0, util$1.initNeedSeries)(series, config.lineConfig, 'line');
- lines = calcLinesPosition(lines, chart);
- }
-
- (0, updater_class.doUpdate)({
- chart: chart,
- series: lines,
- key: 'lineArea',
- getGraphConfig: getLineAreaConfig,
- getStartGraphConfig: getStartLineAreaConfig,
- beforeUpdate: beforeUpdateLineAndArea,
- beforeChange: beforeChangeLineAndArea
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: lines,
- key: 'line',
- getGraphConfig: getLineConfig,
- getStartGraphConfig: getStartLineConfig,
- beforeUpdate: beforeUpdateLineAndArea,
- beforeChange: beforeChangeLineAndArea
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: lines,
- key: 'linePoint',
- getGraphConfig: getPointConfig,
- getStartGraphConfig: getStartPointConfig
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: lines,
- key: 'lineLabel',
- getGraphConfig: getLabelConfig
- });
- }
-
- function calcLinesPosition(lines, chart) {
- var axisData = chart.axisData;
- return lines.map(function (lineItem) {
- var lineData = (0, util$1.mergeSameStackData)(lineItem, lines);
- lineData = mergeNonNumber(lineItem, lineData);
- var lineAxis = getLineAxis(lineItem, axisData);
- var linePosition = getLinePosition(lineData, lineAxis);
- var lineFillBottomPos = getLineFillBottomPos(lineAxis);
- return _objectSpread({}, lineItem, {
- linePosition: linePosition.filter(function (p) {
- return p;
- }),
- lineFillBottomPos: lineFillBottomPos
- });
- });
- }
-
- function mergeNonNumber(lineItem, lineData) {
- var data = lineItem.data;
- return lineData.map(function (v, i) {
- return typeof data[i] === 'number' ? v : null;
- });
- }
-
- function getLineAxis(line, axisData) {
- var xAxisIndex = line.xAxisIndex,
- yAxisIndex = line.yAxisIndex;
- var xAxis = axisData.find(function (_ref) {
- var axis = _ref.axis,
- index = _ref.index;
- return axis === 'x' && index === xAxisIndex;
- });
- var yAxis = axisData.find(function (_ref2) {
- var axis = _ref2.axis,
- index = _ref2.index;
- return axis === 'y' && index === yAxisIndex;
- });
- return [xAxis, yAxis];
- }
-
- function getLinePosition(lineData, lineAxis) {
- var valueAxisIndex = lineAxis.findIndex(function (_ref3) {
- var data = _ref3.data;
- return data === 'value';
- });
- var valueAxis = lineAxis[valueAxisIndex];
- var labelAxis = lineAxis[1 - valueAxisIndex];
- var linePosition = valueAxis.linePosition,
- axis = valueAxis.axis;
- var tickPosition = labelAxis.tickPosition;
- var tickNum = tickPosition.length;
- var valueAxisPosIndex = axis === 'x' ? 0 : 1;
- var valueAxisStartPos = linePosition[0][valueAxisPosIndex];
- var valueAxisEndPos = linePosition[1][valueAxisPosIndex];
- var valueAxisPosMinus = valueAxisEndPos - valueAxisStartPos;
- var maxValue = valueAxis.maxValue,
- minValue = valueAxis.minValue;
- var valueMinus = maxValue - minValue;
- var position = new Array(tickNum).fill(0).map(function (foo, i) {
- var v = lineData[i];
- if (typeof v !== 'number') return null;
- var valuePercent = (v - minValue) / valueMinus;
- if (valueMinus === 0) valuePercent = 0;
- return valuePercent * valueAxisPosMinus + valueAxisStartPos;
- });
- return position.map(function (vPos, i) {
- if (i >= tickNum || typeof vPos !== 'number') return null;
- var pos = [vPos, tickPosition[i][1 - valueAxisPosIndex]];
- if (valueAxisPosIndex === 0) return pos;
- pos.reverse();
- return pos;
- });
- }
-
- function getLineFillBottomPos(lineAxis) {
- var valueAxis = lineAxis.find(function (_ref4) {
- var data = _ref4.data;
- return data === 'value';
- });
- var axis = valueAxis.axis,
- linePosition = valueAxis.linePosition,
- minValue = valueAxis.minValue,
- maxValue = valueAxis.maxValue;
- var changeIndex = axis === 'x' ? 0 : 1;
- var changeValue = linePosition[0][changeIndex];
-
- if (minValue < 0 && maxValue > 0) {
- var valueMinus = maxValue - minValue;
- var posMinus = Math.abs(linePosition[0][changeIndex] - linePosition[1][changeIndex]);
- var offset = Math.abs(minValue) / valueMinus * posMinus;
- if (axis === 'y') offset *= -1;
- changeValue += offset;
- }
-
- return {
- changeIndex: changeIndex,
- changeValue: changeValue
- };
- }
-
- function getLineAreaConfig(lineItem) {
- var animationCurve = lineItem.animationCurve,
- animationFrame = lineItem.animationFrame,
- lineFillBottomPos = lineItem.lineFillBottomPos,
- rLevel = lineItem.rLevel;
- return [{
- name: getLineGraphName(lineItem),
- index: rLevel,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- visible: lineItem.lineArea.show,
- lineFillBottomPos: lineFillBottomPos,
- shape: getLineAndAreaShape(lineItem),
- style: getLineAreaStyle(lineItem),
- drawed: lineAreaDrawed
- }];
- }
-
- function getLineAndAreaShape(lineItem) {
- var linePosition = lineItem.linePosition;
- return {
- points: linePosition
- };
- }
-
- function getLineAreaStyle(lineItem) {
- var lineArea = lineItem.lineArea,
- color = lineItem.color;
- var gradient = lineArea.gradient,
- style = lineArea.style;
- var fillColor = [style.fill || color];
- var gradientColor = (0, util$1.deepMerge)(fillColor, gradient);
- if (gradientColor.length === 1) gradientColor.push(gradientColor[0]);
- var gradientParams = getGradientParams(lineItem);
- style = _objectSpread({}, style, {
- stroke: 'rgba(0, 0, 0, 0)'
- });
- return (0, util$1.deepMerge)({
- gradientColor: gradientColor,
- gradientParams: gradientParams,
- gradientType: 'linear',
- gradientWith: 'fill'
- }, style);
- }
-
- function getGradientParams(lineItem) {
- var lineFillBottomPos = lineItem.lineFillBottomPos,
- linePosition = lineItem.linePosition;
- var changeIndex = lineFillBottomPos.changeIndex,
- changeValue = lineFillBottomPos.changeValue;
- var mainPos = linePosition.map(function (p) {
- return p[changeIndex];
- });
- var maxPos = Math.max.apply(Math, (0, _toConsumableArray2["default"])(mainPos));
- var minPos = Math.min.apply(Math, (0, _toConsumableArray2["default"])(mainPos));
- var beginPos = maxPos;
- if (changeIndex === 1) beginPos = minPos;
-
- if (changeIndex === 1) {
- return [0, beginPos, 0, changeValue];
- } else {
- return [beginPos, 0, changeValue, 0];
- }
- }
-
- function lineAreaDrawed(_ref5, _ref6) {
- var lineFillBottomPos = _ref5.lineFillBottomPos,
- shape = _ref5.shape;
- var ctx = _ref6.ctx;
- var points = shape.points;
- var changeIndex = lineFillBottomPos.changeIndex,
- changeValue = lineFillBottomPos.changeValue;
- var linePoint1 = (0, _toConsumableArray2["default"])(points[points.length - 1]);
- var linePoint2 = (0, _toConsumableArray2["default"])(points[0]);
- linePoint1[changeIndex] = changeValue;
- linePoint2[changeIndex] = changeValue;
- ctx.lineTo.apply(ctx, (0, _toConsumableArray2["default"])(linePoint1));
- ctx.lineTo.apply(ctx, (0, _toConsumableArray2["default"])(linePoint2));
- ctx.closePath();
- ctx.fill();
- }
-
- function getStartLineAreaConfig(lineItem) {
- var config = getLineAreaConfig(lineItem)[0];
-
- var style = _objectSpread({}, config.style);
-
- style.opacity = 0;
- config.style = style;
- return [config];
- }
-
- function beforeUpdateLineAndArea(graphs, lineItem, i, updater) {
- var cache = graphs[i];
- if (!cache) return;
- var currentName = getLineGraphName(lineItem);
- var render = updater.chart.render;
- var name = cache[0].name;
- var delAll = currentName !== name;
- if (!delAll) return;
- cache.forEach(function (g) {
- return render.delGraph(g);
- });
- graphs[i] = null;
- }
-
- function beforeChangeLineAndArea(graph, config) {
- var points = config.shape.points;
- var graphPoints = graph.shape.points;
- var graphPointsNum = graphPoints.length;
- var pointsNum = points.length;
-
- if (pointsNum > graphPointsNum) {
- var lastPoint = graphPoints.slice(-1)[0];
- var newAddPoints = new Array(pointsNum - graphPointsNum).fill(0).map(function (foo) {
- return (0, _toConsumableArray2["default"])(lastPoint);
- });
- graphPoints.push.apply(graphPoints, (0, _toConsumableArray2["default"])(newAddPoints));
- } else if (pointsNum < graphPointsNum) {
- graphPoints.splice(pointsNum);
- }
- }
-
- function getLineConfig(lineItem) {
- var animationCurve = lineItem.animationCurve,
- animationFrame = lineItem.animationFrame,
- rLevel = lineItem.rLevel;
- return [{
- name: getLineGraphName(lineItem),
- index: rLevel + 1,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getLineAndAreaShape(lineItem),
- style: getLineStyle(lineItem)
- }];
- }
-
- function getLineGraphName(lineItem) {
- var smooth = lineItem.smooth;
- return smooth ? 'smoothline' : 'polyline';
- }
-
- function getLineStyle(lineItem) {
- var lineStyle = lineItem.lineStyle,
- color = lineItem.color,
- smooth = lineItem.smooth,
- linePosition = lineItem.linePosition;
- var lineLength = getLineLength(linePosition, smooth);
- return (0, util$1.deepMerge)({
- stroke: color,
- lineDash: [lineLength, 0]
- }, lineStyle);
- }
-
- function getLineLength(points) {
- var smooth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- if (!smooth) return (0, util$1.getPolylineLength)(points);
- var curve = polylineToBezierCurve(points);
- return getBezierCurveLength(curve);
- }
-
- function getStartLineConfig(lineItem) {
- var lineDash = lineItem.lineStyle.lineDash;
- var config = getLineConfig(lineItem)[0];
- var realLineDash = config.style.lineDash;
-
- if (lineDash) {
- realLineDash = [0, 0];
- } else {
- realLineDash = (0, _toConsumableArray2["default"])(realLineDash).reverse();
- }
-
- config.style.lineDash = realLineDash;
- return [config];
- }
-
- function getPointConfig(lineItem) {
- var animationCurve = lineItem.animationCurve,
- animationFrame = lineItem.animationFrame,
- rLevel = lineItem.rLevel;
- var shapes = getPointShapes(lineItem);
- var style = getPointStyle(lineItem);
- return shapes.map(function (shape) {
- return {
- name: 'circle',
- index: rLevel + 2,
- visible: lineItem.linePoint.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: shape,
- style: style
- };
- });
- }
-
- function getPointShapes(lineItem) {
- var linePosition = lineItem.linePosition,
- radius = lineItem.linePoint.radius;
- return linePosition.map(function (_ref7) {
- var _ref8 = (0, _slicedToArray2["default"])(_ref7, 2),
- rx = _ref8[0],
- ry = _ref8[1];
-
- return {
- r: radius,
- rx: rx,
- ry: ry
- };
- });
- }
-
- function getPointStyle(lineItem) {
- var color = lineItem.color,
- style = lineItem.linePoint.style;
- return (0, util$1.deepMerge)({
- stroke: color
- }, style);
- }
-
- function getStartPointConfig(lineItem) {
- var configs = getPointConfig(lineItem);
- configs.forEach(function (config) {
- config.shape.r = 0.1;
- });
- return configs;
- }
-
- function getLabelConfig(lineItem) {
- var animationCurve = lineItem.animationCurve,
- animationFrame = lineItem.animationFrame,
- rLevel = lineItem.rLevel;
- var shapes = getLabelShapes(lineItem);
- var style = getLabelStyle(lineItem);
- return shapes.map(function (shape, i) {
- return {
- name: 'text',
- index: rLevel + 3,
- visible: lineItem.label.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: shape,
- style: style
- };
- });
- }
-
- function getLabelShapes(lineItem) {
- var contents = formatterLabel(lineItem);
- var position = getLabelPosition(lineItem);
- return contents.map(function (content, i) {
- return {
- content: content,
- position: position[i]
- };
- });
- }
-
- function getLabelPosition(lineItem) {
- var linePosition = lineItem.linePosition,
- lineFillBottomPos = lineItem.lineFillBottomPos,
- label = lineItem.label;
- var position = label.position,
- offset = label.offset;
- var changeIndex = lineFillBottomPos.changeIndex,
- changeValue = lineFillBottomPos.changeValue;
- return linePosition.map(function (pos) {
- if (position === 'bottom') {
- pos = (0, _toConsumableArray2["default"])(pos);
- pos[changeIndex] = changeValue;
- }
-
- if (position === 'center') {
- var bottom = (0, _toConsumableArray2["default"])(pos);
- bottom[changeIndex] = changeValue;
- pos = getCenterLabelPoint(pos, bottom);
- }
-
- return getOffsetedPoint(pos, offset);
- });
- }
-
- function getOffsetedPoint(_ref9, _ref10) {
- var _ref11 = (0, _slicedToArray2["default"])(_ref9, 2),
- x = _ref11[0],
- y = _ref11[1];
-
- var _ref12 = (0, _slicedToArray2["default"])(_ref10, 2),
- ox = _ref12[0],
- oy = _ref12[1];
-
- return [x + ox, y + oy];
- }
-
- function getCenterLabelPoint(_ref13, _ref14) {
- var _ref15 = (0, _slicedToArray2["default"])(_ref13, 2),
- ax = _ref15[0],
- ay = _ref15[1];
-
- var _ref16 = (0, _slicedToArray2["default"])(_ref14, 2),
- bx = _ref16[0],
- by = _ref16[1];
-
- return [(ax + bx) / 2, (ay + by) / 2];
- }
-
- function formatterLabel(lineItem) {
- var data = lineItem.data,
- formatter = lineItem.label.formatter;
- data = data.filter(function (d) {
- return typeof d === 'number';
- }).map(function (d) {
- return d.toString();
- });
- if (!formatter) return data;
- var type = (0, _typeof2["default"])(formatter);
- if (type === 'string') return data.map(function (d) {
- return formatter.replace('{value}', d);
- });
- if (type === 'function') return data.map(function (value, index) {
- return formatter({
- value: value,
- index: index
- });
- });
- return data;
- }
-
- function getLabelStyle(lineItem) {
- var color = lineItem.color,
- style = lineItem.label.style;
- return (0, util$1.deepMerge)({
- fill: color
- }, style);
- }
- });
-
- unwrapExports(line_1$1);
- var line_2 = line_1$1.line;
-
- var bar_1$1 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.bar = bar;
-
- var _typeof2 = interopRequireDefault(_typeof_1);
-
- var _defineProperty2 = interopRequireDefault(defineProperty);
-
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
-
-
-
-
-
-
-
-
- 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; }
-
- 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; }
-
- function bar(chart) {
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var xAxis = option.xAxis,
- yAxis = option.yAxis,
- series = option.series;
- var bars = [];
-
- if (xAxis && yAxis && series) {
- bars = (0, util$1.initNeedSeries)(series, config.barConfig, 'bar');
- bars = setBarAxis(bars, chart);
- bars = setBarPositionData(bars);
- bars = calcBarsPosition(bars);
- }
-
- (0, updater_class.doUpdate)({
- chart: chart,
- series: bars.slice(-1),
- key: 'backgroundBar',
- getGraphConfig: getBackgroundBarConfig
- });
- bars.reverse();
- (0, updater_class.doUpdate)({
- chart: chart,
- series: bars,
- key: 'bar',
- getGraphConfig: getBarConfig,
- getStartGraphConfig: getStartBarConfig,
- beforeUpdate: beforeUpdateBar
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: bars,
- key: 'barLabel',
- getGraphConfig: getLabelConfig
- });
- }
-
- function setBarAxis(bars, chart) {
- var axisData = chart.axisData;
- bars.forEach(function (bar) {
- var xAxisIndex = bar.xAxisIndex,
- yAxisIndex = bar.yAxisIndex;
- if (typeof xAxisIndex !== 'number') xAxisIndex = 0;
- if (typeof yAxisIndex !== 'number') yAxisIndex = 0;
- var xAxis = axisData.find(function (_ref) {
- var axis = _ref.axis,
- index = _ref.index;
- return "".concat(axis).concat(index) === "x".concat(xAxisIndex);
- });
- var yAxis = axisData.find(function (_ref2) {
- var axis = _ref2.axis,
- index = _ref2.index;
- return "".concat(axis).concat(index) === "y".concat(yAxisIndex);
- });
- var axis = [xAxis, yAxis];
- var valueAxisIndex = axis.findIndex(function (_ref3) {
- var data = _ref3.data;
- return data === 'value';
- });
- bar.valueAxis = axis[valueAxisIndex];
- bar.labelAxis = axis[1 - valueAxisIndex];
- });
- return bars;
- }
-
- function setBarPositionData(bars, chart) {
- var labelBarGroup = groupBarByLabelAxis(bars);
- labelBarGroup.forEach(function (group) {
- setBarIndex(group);
- setBarNum(group);
- setBarCategoryWidth(group);
- setBarWidthAndGap(group);
- setBarAllWidthAndGap(group);
- });
- return bars;
- }
-
- function setBarIndex(bars) {
- var stacks = getBarStack(bars);
- stacks = stacks.map(function (stack) {
- return {
- stack: stack,
- index: -1
- };
- });
- var currentIndex = 0;
- bars.forEach(function (bar) {
- var stack = bar.stack;
-
- if (!stack) {
- bar.barIndex = currentIndex;
- currentIndex++;
- } else {
- var stackData = stacks.find(function (_ref4) {
- var s = _ref4.stack;
- return s === stack;
- });
-
- if (stackData.index === -1) {
- stackData.index = currentIndex;
- currentIndex++;
- }
-
- bar.barIndex = stackData.index;
- }
- });
- }
-
- function groupBarByLabelAxis(bars) {
- var labelAxis = bars.map(function (_ref5) {
- var _ref5$labelAxis = _ref5.labelAxis,
- axis = _ref5$labelAxis.axis,
- index = _ref5$labelAxis.index;
- return axis + index;
- });
- labelAxis = (0, _toConsumableArray2["default"])(new Set(labelAxis));
- return labelAxis.map(function (axisIndex) {
- return bars.filter(function (_ref6) {
- var _ref6$labelAxis = _ref6.labelAxis,
- axis = _ref6$labelAxis.axis,
- index = _ref6$labelAxis.index;
- return axis + index === axisIndex;
- });
- });
- }
-
- function getBarStack(bars) {
- var stacks = [];
- bars.forEach(function (_ref7) {
- var stack = _ref7.stack;
- if (stack) stacks.push(stack);
- });
- return (0, _toConsumableArray2["default"])(new Set(stacks));
- }
-
- function setBarNum(bars) {
- var barNum = (0, _toConsumableArray2["default"])(new Set(bars.map(function (_ref8) {
- var barIndex = _ref8.barIndex;
- return barIndex;
- }))).length;
- bars.forEach(function (bar) {
- return bar.barNum = barNum;
- });
- }
-
- function setBarCategoryWidth(bars) {
- var lastBar = bars.slice(-1)[0];
- var barCategoryGap = lastBar.barCategoryGap,
- tickGap = lastBar.labelAxis.tickGap;
- var barCategoryWidth = 0;
-
- if (typeof barCategoryGap === 'number') {
- barCategoryWidth = barCategoryGap;
- } else {
- barCategoryWidth = (1 - parseInt(barCategoryGap) / 100) * tickGap;
- }
-
- bars.forEach(function (bar) {
- return bar.barCategoryWidth = barCategoryWidth;
- });
- }
-
- function setBarWidthAndGap(bars) {
- var _bars$slice$ = bars.slice(-1)[0],
- barCategoryWidth = _bars$slice$.barCategoryWidth,
- barWidth = _bars$slice$.barWidth,
- barGap = _bars$slice$.barGap,
- barNum = _bars$slice$.barNum;
- var widthAndGap = [];
-
- if (typeof barWidth === 'number' || barWidth !== 'auto') {
- widthAndGap = getBarWidthAndGapWithPercentOrNumber(barCategoryWidth, barWidth, barGap);
- } else if (barWidth === 'auto') {
- widthAndGap = getBarWidthAndGapWidthAuto(barCategoryWidth, barWidth, barGap, barNum);
- }
-
- var _widthAndGap = widthAndGap,
- _widthAndGap2 = (0, _slicedToArray2["default"])(_widthAndGap, 2),
- width = _widthAndGap2[0],
- gap = _widthAndGap2[1];
-
- bars.forEach(function (bar) {
- bar.barWidth = width;
- bar.barGap = gap;
- });
- }
-
- function getBarWidthAndGapWithPercentOrNumber(barCategoryWidth, barWidth, barGap) {
- var width = 0,
- gap = 0;
-
- if (typeof barWidth === 'number') {
- width = barWidth;
- } else {
- width = parseInt(barWidth) / 100 * barCategoryWidth;
- }
-
- if (typeof barGap === 'number') {
- gap = barGap;
- } else {
- gap = parseInt(barGap) / 100 * width;
- }
-
- return [width, gap];
- }
-
- function getBarWidthAndGapWidthAuto(barCategoryWidth, barWidth, barGap, barNum) {
- var width = 0,
- gap = 0;
- var barItemWidth = barCategoryWidth / barNum;
-
- if (typeof barGap === 'number') {
- gap = barGap;
- width = barItemWidth - gap;
- } else {
- var percent = 10 + parseInt(barGap) / 10;
-
- if (percent === 0) {
- width = barItemWidth * 2;
- gap = -width;
- } else {
- width = barItemWidth / percent * 10;
- gap = barItemWidth - width;
- }
- }
-
- return [width, gap];
- }
-
- function setBarAllWidthAndGap(bars) {
- var _bars$slice$2 = bars.slice(-1)[0],
- barGap = _bars$slice$2.barGap,
- barWidth = _bars$slice$2.barWidth,
- barNum = _bars$slice$2.barNum;
- var barAllWidthAndGap = (barGap + barWidth) * barNum - barGap;
- bars.forEach(function (bar) {
- return bar.barAllWidthAndGap = barAllWidthAndGap;
- });
- }
-
- function calcBarsPosition(bars, chart) {
- bars = calcBarValueAxisCoordinate(bars);
- bars = calcBarLabelAxisCoordinate(bars);
- bars = eliminateNullBarLabelAxis(bars);
- bars = keepSameNumBetweenBarAndData(bars);
- return bars;
- }
-
- function calcBarLabelAxisCoordinate(bars) {
- return bars.map(function (bar) {
- var labelAxis = bar.labelAxis,
- barAllWidthAndGap = bar.barAllWidthAndGap,
- barGap = bar.barGap,
- barWidth = bar.barWidth,
- barIndex = bar.barIndex;
- var tickGap = labelAxis.tickGap,
- tickPosition = labelAxis.tickPosition,
- axis = labelAxis.axis;
- var coordinateIndex = axis === 'x' ? 0 : 1;
- var barLabelAxisPos = tickPosition.map(function (tick, i) {
- var barCategoryStartPos = tickPosition[i][coordinateIndex] - tickGap / 2;
- var barItemsStartPos = barCategoryStartPos + (tickGap - barAllWidthAndGap) / 2;
- return barItemsStartPos + (barIndex + 0.5) * barWidth + barIndex * barGap;
- });
- return _objectSpread({}, bar, {
- barLabelAxisPos: barLabelAxisPos
- });
- });
- }
-
- function calcBarValueAxisCoordinate(bars) {
- return bars.map(function (bar) {
- var data = (0, util$1.mergeSameStackData)(bar, bars);
- data = eliminateNonNumberData(bar, data);
- var _bar$valueAxis = bar.valueAxis,
- axis = _bar$valueAxis.axis,
- minValue = _bar$valueAxis.minValue,
- maxValue = _bar$valueAxis.maxValue,
- linePosition = _bar$valueAxis.linePosition;
- var startPos = getValuePos(minValue, maxValue, minValue < 0 ? 0 : minValue, linePosition, axis);
- var endPos = data.map(function (v) {
- return getValuePos(minValue, maxValue, v, linePosition, axis);
- });
- var barValueAxisPos = endPos.map(function (p) {
- return [startPos, p];
- });
- return _objectSpread({}, bar, {
- barValueAxisPos: barValueAxisPos
- });
- });
- }
-
- function eliminateNonNumberData(barItem, barData) {
- var data = barItem.data;
- return barData.map(function (v, i) {
- return typeof data[i] === 'number' ? v : null;
- }).filter(function (d) {
- return d !== null;
- });
- }
-
- function eliminateNullBarLabelAxis(bars) {
- return bars.map(function (bar) {
- var barLabelAxisPos = bar.barLabelAxisPos,
- data = bar.data;
- data.forEach(function (d, i) {
- if (typeof d === 'number') return;
- barLabelAxisPos[i] = null;
- });
- return _objectSpread({}, bar, {
- barLabelAxisPos: barLabelAxisPos.filter(function (p) {
- return p !== null;
- })
- });
- });
- }
-
- function keepSameNumBetweenBarAndData(bars) {
- bars.forEach(function (bar) {
- var data = bar.data,
- barLabelAxisPos = bar.barLabelAxisPos,
- barValueAxisPos = bar.barValueAxisPos;
- var dataNum = data.filter(function (d) {
- return typeof d === 'number';
- }).length;
- var axisPosNum = barLabelAxisPos.length;
-
- if (axisPosNum > dataNum) {
- barLabelAxisPos.splice(dataNum);
- barValueAxisPos.splice(dataNum);
- }
- });
- return bars;
- }
-
- function getValuePos(min, max, value, linePosition, axis) {
- if (typeof value !== 'number') return null;
- var valueMinus = max - min;
- var coordinateIndex = axis === 'x' ? 0 : 1;
- var posMinus = linePosition[1][coordinateIndex] - linePosition[0][coordinateIndex];
- var percent = (value - min) / valueMinus;
- if (valueMinus === 0) percent = 0;
- var pos = percent * posMinus;
- return pos + linePosition[0][coordinateIndex];
- }
-
- function getBackgroundBarConfig(barItem) {
- var animationCurve = barItem.animationCurve,
- animationFrame = barItem.animationFrame,
- rLevel = barItem.rLevel;
- var shapes = getBackgroundBarShapes(barItem);
- var style = getBackgroundBarStyle(barItem);
- return shapes.map(function (shape) {
- return {
- name: 'rect',
- index: rLevel,
- visible: barItem.backgroundBar.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: shape,
- style: style
- };
- });
- }
-
- function getBackgroundBarShapes(barItem) {
- var labelAxis = barItem.labelAxis,
- valueAxis = barItem.valueAxis;
- var tickPosition = labelAxis.tickPosition;
- var axis = valueAxis.axis,
- linePosition = valueAxis.linePosition;
- var width = getBackgroundBarWidth(barItem);
- var haltWidth = width / 2;
- var posIndex = axis === 'x' ? 0 : 1;
- var centerPos = tickPosition.map(function (p) {
- return p[1 - posIndex];
- });
- var _ref9 = [linePosition[0][posIndex], linePosition[1][posIndex]],
- start = _ref9[0],
- end = _ref9[1];
- return centerPos.map(function (center) {
- if (axis === 'x') {
- return {
- x: start,
- y: center - haltWidth,
- w: end - start,
- h: width
- };
- } else {
- return {
- x: center - haltWidth,
- y: end,
- w: width,
- h: start - end
- };
- }
- });
- }
-
- function getBackgroundBarWidth(barItem) {
- var barAllWidthAndGap = barItem.barAllWidthAndGap,
- barCategoryWidth = barItem.barCategoryWidth,
- backgroundBar = barItem.backgroundBar;
- var width = backgroundBar.width;
- if (typeof width === 'number') return width;
- if (width === 'auto') return barAllWidthAndGap;
- return parseInt(width) / 100 * barCategoryWidth;
- }
-
- function getBackgroundBarStyle(barItem) {
- return barItem.backgroundBar.style;
- }
-
- function getBarConfig(barItem) {
- var barLabelAxisPos = barItem.barLabelAxisPos,
- animationCurve = barItem.animationCurve,
- animationFrame = barItem.animationFrame,
- rLevel = barItem.rLevel;
- var name = getBarName(barItem);
- return barLabelAxisPos.map(function (foo, i) {
- return {
- name: name,
- index: rLevel,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getBarShape(barItem, i),
- style: getBarStyle(barItem, i)
- };
- });
- }
-
- function getBarName(barItem) {
- var shapeType = barItem.shapeType;
- if (shapeType === 'leftEchelon' || shapeType === 'rightEchelon') return 'polyline';
- return 'rect';
- }
-
- function getBarShape(barItem, i) {
- var shapeType = barItem.shapeType;
-
- if (shapeType === 'leftEchelon') {
- return getLeftEchelonShape(barItem, i);
- } else if (shapeType === 'rightEchelon') {
- return getRightEchelonShape(barItem, i);
- } else {
- return getNormalBarShape(barItem, i);
- }
- }
-
- function getLeftEchelonShape(barItem, i) {
- var barValueAxisPos = barItem.barValueAxisPos,
- barLabelAxisPos = barItem.barLabelAxisPos,
- barWidth = barItem.barWidth,
- echelonOffset = barItem.echelonOffset;
-
- var _barValueAxisPos$i = (0, _slicedToArray2["default"])(barValueAxisPos[i], 2),
- start = _barValueAxisPos$i[0],
- end = _barValueAxisPos$i[1];
-
- var labelAxisPos = barLabelAxisPos[i];
- var halfWidth = barWidth / 2;
- var valueAxis = barItem.valueAxis.axis;
- var points = [];
-
- if (valueAxis === 'x') {
- points[0] = [end, labelAxisPos - halfWidth];
- points[1] = [end, labelAxisPos + halfWidth];
- points[2] = [start, labelAxisPos + halfWidth];
- points[3] = [start + echelonOffset, labelAxisPos - halfWidth];
- if (end - start < echelonOffset) points.splice(3, 1);
- } else {
- points[0] = [labelAxisPos - halfWidth, end];
- points[1] = [labelAxisPos + halfWidth, end];
- points[2] = [labelAxisPos + halfWidth, start];
- points[3] = [labelAxisPos - halfWidth, start - echelonOffset];
- if (start - end < echelonOffset) points.splice(3, 1);
- }
-
- return {
- points: points,
- close: true
- };
- }
-
- function getRightEchelonShape(barItem, i) {
- var barValueAxisPos = barItem.barValueAxisPos,
- barLabelAxisPos = barItem.barLabelAxisPos,
- barWidth = barItem.barWidth,
- echelonOffset = barItem.echelonOffset;
-
- var _barValueAxisPos$i2 = (0, _slicedToArray2["default"])(barValueAxisPos[i], 2),
- start = _barValueAxisPos$i2[0],
- end = _barValueAxisPos$i2[1];
-
- var labelAxisPos = barLabelAxisPos[i];
- var halfWidth = barWidth / 2;
- var valueAxis = barItem.valueAxis.axis;
- var points = [];
-
- if (valueAxis === 'x') {
- points[0] = [end, labelAxisPos + halfWidth];
- points[1] = [end, labelAxisPos - halfWidth];
- points[2] = [start, labelAxisPos - halfWidth];
- points[3] = [start + echelonOffset, labelAxisPos + halfWidth];
- if (end - start < echelonOffset) points.splice(2, 1);
- } else {
- points[0] = [labelAxisPos + halfWidth, end];
- points[1] = [labelAxisPos - halfWidth, end];
- points[2] = [labelAxisPos - halfWidth, start];
- points[3] = [labelAxisPos + halfWidth, start - echelonOffset];
- if (start - end < echelonOffset) points.splice(2, 1);
- }
-
- return {
- points: points,
- close: true
- };
- }
-
- function getNormalBarShape(barItem, i) {
- var barValueAxisPos = barItem.barValueAxisPos,
- barLabelAxisPos = barItem.barLabelAxisPos,
- barWidth = barItem.barWidth;
-
- var _barValueAxisPos$i3 = (0, _slicedToArray2["default"])(barValueAxisPos[i], 2),
- start = _barValueAxisPos$i3[0],
- end = _barValueAxisPos$i3[1];
-
- var labelAxisPos = barLabelAxisPos[i];
- var valueAxis = barItem.valueAxis.axis;
- var shape = {};
-
- if (valueAxis === 'x') {
- shape.x = start;
- shape.y = labelAxisPos - barWidth / 2;
- shape.w = end - start;
- shape.h = barWidth;
- } else {
- shape.x = labelAxisPos - barWidth / 2;
- shape.y = end;
- shape.w = barWidth;
- shape.h = start - end;
- }
-
- return shape;
- }
-
- function getBarStyle(barItem, i) {
- var barStyle = barItem.barStyle,
- gradient = barItem.gradient,
- color = barItem.color,
- independentColor = barItem.independentColor,
- independentColors = barItem.independentColors;
- var fillColor = [barStyle.fill || color];
- var gradientColor = (0, util$1.deepMerge)(fillColor, gradient.color);
-
- if (independentColor) {
- var idtColor = independentColors[i % independentColors.length];
- gradientColor = idtColor instanceof Array ? idtColor : [idtColor];
- }
-
- if (gradientColor.length === 1) gradientColor.push(gradientColor[0]);
- var gradientParams = getGradientParams(barItem, i);
- return (0, util$1.deepMerge)({
- gradientColor: gradientColor,
- gradientParams: gradientParams,
- gradientType: 'linear',
- gradientWith: 'fill'
- }, barStyle);
- }
-
- function getGradientParams(barItem, i) {
- var barValueAxisPos = barItem.barValueAxisPos,
- barLabelAxisPos = barItem.barLabelAxisPos,
- data = barItem.data;
- var _barItem$valueAxis = barItem.valueAxis,
- linePosition = _barItem$valueAxis.linePosition,
- axis = _barItem$valueAxis.axis;
-
- var _barValueAxisPos$i4 = (0, _slicedToArray2["default"])(barValueAxisPos[i], 2),
- start = _barValueAxisPos$i4[0],
- end = _barValueAxisPos$i4[1];
-
- var labelAxisPos = barLabelAxisPos[i];
- var value = data[i];
-
- var _linePosition = (0, _slicedToArray2["default"])(linePosition, 2),
- lineStart = _linePosition[0],
- lineEnd = _linePosition[1];
-
- var valueAxisIndex = axis === 'x' ? 0 : 1;
- var endPos = end;
-
- if (!barItem.gradient.local) {
- endPos = value < 0 ? lineStart[valueAxisIndex] : lineEnd[valueAxisIndex];
- }
-
- if (axis === 'y') {
- return [labelAxisPos, endPos, labelAxisPos, start];
- } else {
- return [endPos, labelAxisPos, start, labelAxisPos];
- }
- }
-
- function getStartBarConfig(barItem) {
- var configs = getBarConfig(barItem);
- var shapeType = barItem.shapeType;
- configs.forEach(function (config) {
- var shape = config.shape;
-
- if (shapeType === 'leftEchelon') {
- shape = getStartLeftEchelonShape(shape, barItem);
- } else if (shapeType === 'rightEchelon') {
- shape = getStartRightEchelonShape(shape, barItem);
- } else {
- shape = getStartNormalBarShape(shape, barItem);
- }
-
- config.shape = shape;
- });
- return configs;
- }
-
- function getStartLeftEchelonShape(shape, barItem) {
- var axis = barItem.valueAxis.axis;
- shape = (0, util.deepClone)(shape);
- var _shape = shape,
- points = _shape.points;
- var index = axis === 'x' ? 0 : 1;
- var start = points[2][index];
- points.forEach(function (point) {
- return point[index] = start;
- });
- return shape;
- }
-
- function getStartRightEchelonShape(shape, barItem) {
- var axis = barItem.valueAxis.axis;
- shape = (0, util.deepClone)(shape);
- var _shape2 = shape,
- points = _shape2.points;
- var index = axis === 'x' ? 0 : 1;
- var start = points[2][index];
- points.forEach(function (point) {
- return point[index] = start;
- });
- return shape;
- }
-
- function getStartNormalBarShape(shape, barItem) {
- var axis = barItem.valueAxis.axis;
- var x = shape.x,
- y = shape.y,
- w = shape.w,
- h = shape.h;
-
- if (axis === 'x') {
- w = 0;
- } else {
- y = y + h;
- h = 0;
- }
-
- return {
- x: x,
- y: y,
- w: w,
- h: h
- };
- }
-
- function beforeUpdateBar(graphs, barItem, i, updater) {
- var render = updater.chart.render;
- var name = getBarName(barItem);
-
- if (graphs[i] && graphs[i][0].name !== name) {
- graphs[i].forEach(function (g) {
- return render.delGraph(g);
- });
- graphs[i] = null;
- }
- }
-
- function getLabelConfig(barItem) {
- var animationCurve = barItem.animationCurve,
- animationFrame = barItem.animationFrame,
- rLevel = barItem.rLevel;
- var shapes = getLabelShapes(barItem);
- var style = getLabelStyle(barItem);
- return shapes.map(function (shape) {
- return {
- name: 'text',
- index: rLevel,
- visible: barItem.label.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: shape,
- style: style
- };
- });
- }
-
- function getLabelShapes(barItem) {
- var contents = getFormatterLabels(barItem);
- var position = getLabelsPosition(barItem);
- return position.map(function (pos, i) {
- return {
- position: pos,
- content: contents[i]
- };
- });
- }
-
- function getFormatterLabels(barItem) {
- var data = barItem.data,
- label = barItem.label;
- var formatter = label.formatter;
- data = data.filter(function (d) {
- return typeof d === 'number';
- }).map(function (d) {
- return d.toString();
- });
- if (!formatter) return data;
- var type = (0, _typeof2["default"])(formatter);
- if (type === 'string') return data.map(function (d) {
- return formatter.replace('{value}', d);
- });
- if (type === 'function') return data.map(function (d, i) {
- return formatter({
- value: d,
- index: i
- });
- });
- return data;
- }
-
- function getLabelsPosition(barItem) {
- var label = barItem.label,
- barValueAxisPos = barItem.barValueAxisPos,
- barLabelAxisPos = barItem.barLabelAxisPos;
- var position = label.position,
- offset = label.offset;
- var axis = barItem.valueAxis.axis;
- return barValueAxisPos.map(function (_ref10, i) {
- var _ref11 = (0, _slicedToArray2["default"])(_ref10, 2),
- start = _ref11[0],
- end = _ref11[1];
-
- var labelAxisPos = barLabelAxisPos[i];
- var pos = [end, labelAxisPos];
-
- if (position === 'bottom') {
- pos = [start, labelAxisPos];
- }
-
- if (position === 'center') {
- pos = [(start + end) / 2, labelAxisPos];
- }
-
- if (axis === 'y') pos.reverse();
- return getOffsetedPoint(pos, offset);
- });
- }
-
- function getOffsetedPoint(_ref12, _ref13) {
- var _ref14 = (0, _slicedToArray2["default"])(_ref12, 2),
- x = _ref14[0],
- y = _ref14[1];
-
- var _ref15 = (0, _slicedToArray2["default"])(_ref13, 2),
- ox = _ref15[0],
- oy = _ref15[1];
-
- return [x + ox, y + oy];
- }
-
- function getLabelStyle(barItem) {
- var color = barItem.color,
- style = barItem.label.style,
- gc = barItem.gradient.color;
- if (gc.length) color = gc[0];
- style = (0, util$1.deepMerge)({
- fill: color
- }, style);
- return style;
- }
- });
-
- unwrapExports(bar_1$1);
- var bar_2 = bar_1$1.bar;
-
- var pie_1$1 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.pie = pie;
-
- var _defineProperty2 = interopRequireDefault(defineProperty);
-
- var _typeof2 = interopRequireDefault(_typeof_1);
-
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
-
-
-
-
-
-
-
-
- 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; }
-
- 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; }
-
- function pie(chart) {
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var series = option.series;
- if (!series) series = [];
- var pies = (0, util$1.initNeedSeries)(series, pie$1.pieConfig, 'pie');
- pies = calcPiesCenter(pies, chart);
- pies = calcPiesRadius(pies, chart);
- pies = calcRosePiesRadius(pies);
- pies = calcPiesPercent(pies);
- pies = calcPiesAngle(pies);
- pies = calcPiesInsideLabelPos(pies);
- pies = calcPiesEdgeCenterPos(pies);
- pies = calcPiesOutSideLabelPos(pies);
- (0, updater_class.doUpdate)({
- chart: chart,
- series: pies,
- key: 'pie',
- getGraphConfig: getPieConfig,
- getStartGraphConfig: getStartPieConfig,
- beforeChange: beforeChangePie
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: pies,
- key: 'pieInsideLabel',
- getGraphConfig: getInsideLabelConfig
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: pies,
- key: 'pieOutsideLabelLine',
- getGraphConfig: getOutsideLabelLineConfig,
- getStartGraphConfig: getStartOutsideLabelLineConfig
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: pies,
- key: 'pieOutsideLabel',
- getGraphConfig: getOutsideLabelConfig,
- getStartGraphConfig: getStartOutsideLabelConfig
- });
- }
-
- function calcPiesCenter(pies, chart) {
- var area = chart.render.area;
- pies.forEach(function (pie) {
- var center = pie.center;
- center = center.map(function (pos, i) {
- if (typeof pos === 'number') return pos;
- return parseInt(pos) / 100 * area[i];
- });
- pie.center = center;
- });
- return pies;
- }
-
- function calcPiesRadius(pies, chart) {
- var maxRadius = Math.min.apply(Math, (0, _toConsumableArray2["default"])(chart.render.area)) / 2;
- pies.forEach(function (pie) {
- var radius = pie.radius,
- data = pie.data;
- radius = getNumberRadius(radius, maxRadius);
- data.forEach(function (item) {
- var itemRadius = item.radius;
- if (!itemRadius) itemRadius = radius;
- itemRadius = getNumberRadius(itemRadius, maxRadius);
- item.radius = itemRadius;
- });
- pie.radius = radius;
- });
- return pies;
- }
-
- function getNumberRadius(radius, maxRadius) {
- if (!(radius instanceof Array)) radius = [0, radius];
- radius = radius.map(function (r) {
- if (typeof r === 'number') return r;
- return parseInt(r) / 100 * maxRadius;
- });
- return radius;
- }
-
- function calcRosePiesRadius(pies, chart) {
- var rosePie = pies.filter(function (_ref) {
- var roseType = _ref.roseType;
- return roseType;
- });
- rosePie.forEach(function (pie) {
- var radius = pie.radius,
- data = pie.data,
- roseSort = pie.roseSort;
- var roseIncrement = getRoseIncrement(pie);
- var dataCopy = (0, _toConsumableArray2["default"])(data);
- data = sortData(data);
- data.forEach(function (item, i) {
- item.radius[1] = radius[1] - roseIncrement * i;
- });
-
- if (roseSort) {
- data.reverse();
- } else {
- pie.data = dataCopy;
- }
-
- pie.roseIncrement = roseIncrement;
- });
- return pies;
- }
-
- function sortData(data) {
- return data.sort(function (_ref2, _ref3) {
- var a = _ref2.value;
- var b = _ref3.value;
- if (a === b) return 0;
- if (a > b) return -1;
- if (a < b) return 1;
- });
- }
-
- function getRoseIncrement(pie) {
- var radius = pie.radius,
- roseIncrement = pie.roseIncrement;
- if (typeof roseIncrement === 'number') return roseIncrement;
-
- if (roseIncrement === 'auto') {
- var data = pie.data;
- var allRadius = data.reduce(function (all, _ref4) {
- var radius = _ref4.radius;
- return [].concat((0, _toConsumableArray2["default"])(all), (0, _toConsumableArray2["default"])(radius));
- }, []);
- var minRadius = Math.min.apply(Math, (0, _toConsumableArray2["default"])(allRadius));
- var maxRadius = Math.max.apply(Math, (0, _toConsumableArray2["default"])(allRadius));
- return (maxRadius - minRadius) * 0.6 / (data.length - 1 || 1);
- }
-
- return parseInt(roseIncrement) / 100 * radius[1];
- }
-
- function calcPiesPercent(pies) {
- pies.forEach(function (pie) {
- var data = pie.data,
- percentToFixed = pie.percentToFixed;
- var sum = getDataSum(data);
- data.forEach(function (item) {
- var value = item.value;
- item.percent = value / sum * 100;
- item.percentForLabel = toFixedNoCeil(value / sum * 100, percentToFixed);
- });
- var percentSumNoLast = (0, util$1.mulAdd)(data.slice(0, -1).map(function (_ref5) {
- var percent = _ref5.percent;
- return percent;
- }));
- data.slice(-1)[0].percent = 100 - percentSumNoLast;
- data.slice(-1)[0].percentForLabel = toFixedNoCeil(100 - percentSumNoLast, percentToFixed);
- });
- return pies;
- }
-
- function toFixedNoCeil(number) {
- var toFixed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- var stringNumber = number.toString();
- var splitedNumber = stringNumber.split('.');
- var decimal = splitedNumber[1] || '0';
- var fixedDecimal = decimal.slice(0, toFixed);
- splitedNumber[1] = fixedDecimal;
- return parseFloat(splitedNumber.join('.'));
- }
-
- function getDataSum(data) {
- return (0, util$1.mulAdd)(data.map(function (_ref6) {
- var value = _ref6.value;
- return value;
- }));
- }
-
- function calcPiesAngle(pies) {
- pies.forEach(function (pie) {
- var start = pie.startAngle,
- data = pie.data;
- data.forEach(function (item, i) {
- var _getDataAngle = getDataAngle(data, i),
- _getDataAngle2 = (0, _slicedToArray2["default"])(_getDataAngle, 2),
- startAngle = _getDataAngle2[0],
- endAngle = _getDataAngle2[1];
-
- item.startAngle = start + startAngle;
- item.endAngle = start + endAngle;
- });
- });
- return pies;
- }
-
- function getDataAngle(data, i) {
- var fullAngle = Math.PI * 2;
- var needAddData = data.slice(0, i + 1);
- var percentSum = (0, util$1.mulAdd)(needAddData.map(function (_ref7) {
- var percent = _ref7.percent;
- return percent;
- }));
- var percent = data[i].percent;
- var startPercent = percentSum - percent;
- return [fullAngle * startPercent / 100, fullAngle * percentSum / 100];
- }
-
- function calcPiesInsideLabelPos(pies) {
- pies.forEach(function (pieItem) {
- var data = pieItem.data;
- data.forEach(function (item) {
- item.insideLabelPos = getPieInsideLabelPos(pieItem, item);
- });
- });
- return pies;
- }
-
- function getPieInsideLabelPos(pieItem, dataItem) {
- var center = pieItem.center;
-
- var startAngle = dataItem.startAngle,
- endAngle = dataItem.endAngle,
- _dataItem$radius = (0, _slicedToArray2["default"])(dataItem.radius, 2),
- ir = _dataItem$radius[0],
- or = _dataItem$radius[1];
-
- var radius = (ir + or) / 2;
- var angle = (startAngle + endAngle) / 2;
- return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([radius, angle]));
- }
-
- function calcPiesEdgeCenterPos(pies) {
- pies.forEach(function (pie) {
- var data = pie.data,
- center = pie.center;
- data.forEach(function (item) {
- var startAngle = item.startAngle,
- endAngle = item.endAngle,
- radius = item.radius;
- var centerAngle = (startAngle + endAngle) / 2;
-
- var pos = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([radius[1], centerAngle]));
-
- item.edgeCenterPos = pos;
- });
- });
- return pies;
- }
-
- function calcPiesOutSideLabelPos(pies) {
- pies.forEach(function (pieItem) {
- var leftPieDataItems = getLeftOrRightPieDataItems(pieItem);
- var rightPieDataItems = getLeftOrRightPieDataItems(pieItem, false);
- leftPieDataItems = sortPiesFromTopToBottom(leftPieDataItems);
- rightPieDataItems = sortPiesFromTopToBottom(rightPieDataItems);
- addLabelLineAndAlign(leftPieDataItems, pieItem);
- addLabelLineAndAlign(rightPieDataItems, pieItem, false);
- });
- return pies;
- }
-
- function getLabelLineBendRadius(pieItem) {
- var labelLineBendGap = pieItem.outsideLabel.labelLineBendGap;
- var maxRadius = getPieMaxRadius(pieItem);
-
- if (typeof labelLineBendGap !== 'number') {
- labelLineBendGap = parseInt(labelLineBendGap) / 100 * maxRadius;
- }
-
- return labelLineBendGap + maxRadius;
- }
-
- function getPieMaxRadius(pieItem) {
- var data = pieItem.data;
- var radius = data.map(function (_ref8) {
- var _ref8$radius = (0, _slicedToArray2["default"])(_ref8.radius, 2),
- foo = _ref8$radius[0],
- r = _ref8$radius[1];
-
- return r;
- });
- return Math.max.apply(Math, (0, _toConsumableArray2["default"])(radius));
- }
-
- function getLeftOrRightPieDataItems(pieItem) {
- var left = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
- var data = pieItem.data,
- center = pieItem.center;
- var centerXPos = center[0];
- return data.filter(function (_ref9) {
- var edgeCenterPos = _ref9.edgeCenterPos;
- var xPos = edgeCenterPos[0];
- if (left) return xPos <= centerXPos;
- return xPos > centerXPos;
- });
- }
-
- function sortPiesFromTopToBottom(dataItem) {
- dataItem.sort(function (_ref10, _ref11) {
- var _ref10$edgeCenterPos = (0, _slicedToArray2["default"])(_ref10.edgeCenterPos, 2),
- t = _ref10$edgeCenterPos[0],
- ay = _ref10$edgeCenterPos[1];
-
- var _ref11$edgeCenterPos = (0, _slicedToArray2["default"])(_ref11.edgeCenterPos, 2),
- tt = _ref11$edgeCenterPos[0],
- by = _ref11$edgeCenterPos[1];
-
- if (ay > by) return 1;
- if (ay < by) return -1;
- if (ay === by) return 0;
- });
- return dataItem;
- }
-
- function addLabelLineAndAlign(dataItem, pieItem) {
- var left = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
- var center = pieItem.center,
- outsideLabel = pieItem.outsideLabel;
- var radius = getLabelLineBendRadius(pieItem);
- dataItem.forEach(function (item) {
- var edgeCenterPos = item.edgeCenterPos,
- startAngle = item.startAngle,
- endAngle = item.endAngle;
- var labelLineEndLength = outsideLabel.labelLineEndLength;
- var angle = (startAngle + endAngle) / 2;
-
- var bendPoint = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([radius, angle]));
-
- var endPoint = (0, _toConsumableArray2["default"])(bendPoint);
- endPoint[0] += labelLineEndLength * (left ? -1 : 1);
- item.labelLine = [edgeCenterPos, bendPoint, endPoint];
- item.labelLineLength = (0, util$1.getPolylineLength)(item.labelLine);
- item.align = {
- textAlign: 'left',
- textBaseline: 'middle'
- };
- if (left) item.align.textAlign = 'right';
- });
- }
-
- function getPieConfig(pieItem) {
- var data = pieItem.data,
- animationCurve = pieItem.animationCurve,
- animationFrame = pieItem.animationFrame,
- rLevel = pieItem.rLevel;
- return data.map(function (foo, i) {
- return {
- name: 'pie',
- index: rLevel,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getPieShape(pieItem, i),
- style: getPieStyle(pieItem, i)
- };
- });
- }
-
- function getStartPieConfig(pieItem) {
- var animationDelayGap = pieItem.animationDelayGap,
- startAnimationCurve = pieItem.startAnimationCurve;
- var configs = getPieConfig(pieItem);
- configs.forEach(function (config, i) {
- config.animationCurve = startAnimationCurve;
- config.animationDelay = i * animationDelayGap;
- config.shape.or = config.shape.ir;
- });
- return configs;
- }
-
- function beforeChangePie(graph) {
- graph.animationDelay = 0;
- }
-
- function getPieShape(pieItem, i) {
- var center = pieItem.center,
- data = pieItem.data;
- var dataItem = data[i];
- var radius = dataItem.radius,
- startAngle = dataItem.startAngle,
- endAngle = dataItem.endAngle;
- return {
- startAngle: startAngle,
- endAngle: endAngle,
- ir: radius[0],
- or: radius[1],
- rx: center[0],
- ry: center[1]
- };
- }
-
- function getPieStyle(pieItem, i) {
- var pieStyle = pieItem.pieStyle,
- data = pieItem.data;
- var dataItem = data[i];
- var color = dataItem.color;
- return (0, util$1.deepMerge)({
- fill: color
- }, pieStyle);
- }
-
- function getInsideLabelConfig(pieItem) {
- var animationCurve = pieItem.animationCurve,
- animationFrame = pieItem.animationFrame,
- data = pieItem.data,
- rLevel = pieItem.rLevel;
- return data.map(function (foo, i) {
- return {
- name: 'text',
- index: rLevel,
- visible: pieItem.insideLabel.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getInsideLabelShape(pieItem, i),
- style: getInsideLabelStyle(pieItem)
- };
- });
- }
-
- function getInsideLabelShape(pieItem, i) {
- var insideLabel = pieItem.insideLabel,
- data = pieItem.data;
- var formatter = insideLabel.formatter;
- var dataItem = data[i];
- var formatterType = (0, _typeof2["default"])(formatter);
- var label = '';
-
- if (formatterType === 'string') {
- label = formatter.replace('{name}', dataItem.name);
- label = label.replace('{percent}', dataItem.percentForLabel);
- label = label.replace('{value}', dataItem.value);
- }
-
- if (formatterType === 'function') {
- label = formatter(dataItem);
- }
-
- return {
- content: label,
- position: dataItem.insideLabelPos
- };
- }
-
- function getInsideLabelStyle(pieItem, i) {
- var style = pieItem.insideLabel.style;
- return style;
- }
-
- function getOutsideLabelLineConfig(pieItem) {
- var animationCurve = pieItem.animationCurve,
- animationFrame = pieItem.animationFrame,
- data = pieItem.data,
- rLevel = pieItem.rLevel;
- return data.map(function (foo, i) {
- return {
- name: 'polyline',
- index: rLevel,
- visible: pieItem.outsideLabel.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getOutsideLabelLineShape(pieItem, i),
- style: getOutsideLabelLineStyle(pieItem, i)
- };
- });
- }
-
- function getStartOutsideLabelLineConfig(pieItem) {
- var data = pieItem.data;
- var configs = getOutsideLabelLineConfig(pieItem);
- configs.forEach(function (config, i) {
- config.style.lineDash = [0, data[i].labelLineLength];
- });
- return configs;
- }
-
- function getOutsideLabelLineShape(pieItem, i) {
- var data = pieItem.data;
- var dataItem = data[i];
- return {
- points: dataItem.labelLine
- };
- }
-
- function getOutsideLabelLineStyle(pieItem, i) {
- var outsideLabel = pieItem.outsideLabel,
- data = pieItem.data;
- var labelLineStyle = outsideLabel.labelLineStyle;
- var color = data[i].color;
- return (0, util$1.deepMerge)({
- stroke: color,
- lineDash: [data[i].labelLineLength, 0]
- }, labelLineStyle);
- }
-
- function getOutsideLabelConfig(pieItem) {
- var animationCurve = pieItem.animationCurve,
- animationFrame = pieItem.animationFrame,
- data = pieItem.data,
- rLevel = pieItem.rLevel;
- return data.map(function (foo, i) {
- return {
- name: 'text',
- index: rLevel,
- visible: pieItem.outsideLabel.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getOutsideLabelShape(pieItem, i),
- style: getOutsideLabelStyle(pieItem, i)
- };
- });
- }
-
- function getStartOutsideLabelConfig(pieItem) {
- var data = pieItem.data;
- var configs = getOutsideLabelConfig(pieItem);
- configs.forEach(function (config, i) {
- config.shape.position = data[i].labelLine[1];
- });
- return configs;
- }
-
- function getOutsideLabelShape(pieItem, i) {
- var outsideLabel = pieItem.outsideLabel,
- data = pieItem.data;
- var formatter = outsideLabel.formatter;
- var _data$i = data[i],
- labelLine = _data$i.labelLine,
- name = _data$i.name,
- percentForLabel = _data$i.percentForLabel,
- value = _data$i.value;
- var formatterType = (0, _typeof2["default"])(formatter);
- var label = '';
-
- if (formatterType === 'string') {
- label = formatter.replace('{name}', name);
- label = label.replace('{percent}', percentForLabel);
- label = label.replace('{value}', value);
- }
-
- if (formatterType === 'function') {
- label = formatter(data[i]);
- }
-
- return {
- content: label,
- position: labelLine[2]
- };
- }
-
- function getOutsideLabelStyle(pieItem, i) {
- var outsideLabel = pieItem.outsideLabel,
- data = pieItem.data;
- var _data$i2 = data[i],
- color = _data$i2.color,
- align = _data$i2.align;
- var style = outsideLabel.style;
- return (0, util$1.deepMerge)(_objectSpread({
- fill: color
- }, align), style);
- }
- });
-
- unwrapExports(pie_1$1);
- var pie_2 = pie_1$1.pie;
-
- var radarAxis_1$1 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.radarAxis = radarAxis;
-
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
-
- var _defineProperty2 = interopRequireDefault(defineProperty);
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
-
-
-
-
-
-
-
-
- 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; }
-
- 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; }
-
- function radarAxis(chart) {
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var radar = option.radar;
- var radarAxis = [];
-
- if (radar) {
- radarAxis = mergeRadarAxisDefaultConfig(radar);
- radarAxis = calcRadarAxisCenter(radarAxis, chart);
- radarAxis = calcRadarAxisRingRadius(radarAxis, chart);
- radarAxis = calcRadarAxisLinePosition(radarAxis);
- radarAxis = calcRadarAxisAreaRadius(radarAxis);
- radarAxis = calcRadarAxisLabelPosition(radarAxis);
- radarAxis = [radarAxis];
- }
-
- var radarAxisForUpdate = radarAxis;
- if (radarAxis.length && !radarAxis[0].show) radarAxisForUpdate = [];
- (0, updater_class.doUpdate)({
- chart: chart,
- series: radarAxisForUpdate,
- key: 'radarAxisSplitArea',
- getGraphConfig: getSplitAreaConfig,
- beforeUpdate: beforeUpdateSplitArea,
- beforeChange: beforeChangeSplitArea
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: radarAxisForUpdate,
- key: 'radarAxisSplitLine',
- getGraphConfig: getSplitLineConfig,
- beforeUpdate: beforeUpdateSplitLine,
- beforeChange: beforeChangeSplitLine
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: radarAxisForUpdate,
- key: 'radarAxisLine',
- getGraphConfig: getAxisLineConfig
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: radarAxisForUpdate,
- key: 'radarAxisLable',
- getGraphConfig: getAxisLabelConfig
- });
- chart.radarAxis = radarAxis[0];
- }
-
- function mergeRadarAxisDefaultConfig(radar) {
- return (0, util$1.deepMerge)((0, util.deepClone)(config.radarAxisConfig), radar);
- }
-
- function calcRadarAxisCenter(radarAxis, chart) {
- var area = chart.render.area;
- var center = radarAxis.center;
- radarAxis.centerPos = center.map(function (v, i) {
- if (typeof v === 'number') return v;
- return parseInt(v) / 100 * area[i];
- });
- return radarAxis;
- }
-
- function calcRadarAxisRingRadius(radarAxis, chart) {
- var area = chart.render.area;
- var splitNum = radarAxis.splitNum,
- radius = radarAxis.radius;
- var maxRadius = Math.min.apply(Math, (0, _toConsumableArray2["default"])(area)) / 2;
- if (typeof radius !== 'number') radius = parseInt(radius) / 100 * maxRadius;
- var splitGap = radius / splitNum;
- radarAxis.ringRadius = new Array(splitNum).fill(0).map(function (foo, i) {
- return splitGap * (i + 1);
- });
- radarAxis.radius = radius;
- return radarAxis;
- }
-
- function calcRadarAxisLinePosition(radarAxis) {
- var indicator = radarAxis.indicator,
- centerPos = radarAxis.centerPos,
- radius = radarAxis.radius,
- startAngle = radarAxis.startAngle;
- var fullAngle = Math.PI * 2;
- var indicatorNum = indicator.length;
- var indicatorGap = fullAngle / indicatorNum;
- var angles = new Array(indicatorNum).fill(0).map(function (foo, i) {
- return indicatorGap * i + startAngle;
- });
- radarAxis.axisLineAngles = angles;
- radarAxis.axisLinePosition = angles.map(function (g) {
- return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([radius, g]));
- });
- return radarAxis;
- }
-
- function calcRadarAxisAreaRadius(radarAxis) {
- var ringRadius = radarAxis.ringRadius;
- var subRadius = ringRadius[0] / 2;
- radarAxis.areaRadius = ringRadius.map(function (r) {
- return r - subRadius;
- });
- return radarAxis;
- }
-
- function calcRadarAxisLabelPosition(radarAxis) {
- var axisLineAngles = radarAxis.axisLineAngles,
- centerPos = radarAxis.centerPos,
- radius = radarAxis.radius,
- axisLabel = radarAxis.axisLabel;
- radius += axisLabel.labelGap;
- radarAxis.axisLabelPosition = axisLineAngles.map(function (angle) {
- return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([radius, angle]));
- });
- return radarAxis;
- }
-
- function getSplitAreaConfig(radarAxis) {
- var areaRadius = radarAxis.areaRadius,
- polygon = radarAxis.polygon,
- animationCurve = radarAxis.animationCurve,
- animationFrame = radarAxis.animationFrame,
- rLevel = radarAxis.rLevel;
- var name = polygon ? 'regPolygon' : 'ring';
- return areaRadius.map(function (foo, i) {
- return {
- name: name,
- index: rLevel,
- visible: radarAxis.splitArea.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getSplitAreaShape(radarAxis, i),
- style: getSplitAreaStyle(radarAxis, i)
- };
- });
- }
-
- function getSplitAreaShape(radarAxis, i) {
- var polygon = radarAxis.polygon,
- areaRadius = radarAxis.areaRadius,
- indicator = radarAxis.indicator,
- centerPos = radarAxis.centerPos;
- var indicatorNum = indicator.length;
- var shape = {
- rx: centerPos[0],
- ry: centerPos[1],
- r: areaRadius[i]
- };
- if (polygon) shape.side = indicatorNum;
- return shape;
- }
-
- function getSplitAreaStyle(radarAxis, i) {
- var splitArea = radarAxis.splitArea,
- ringRadius = radarAxis.ringRadius,
- axisLineAngles = radarAxis.axisLineAngles,
- polygon = radarAxis.polygon,
- centerPos = radarAxis.centerPos;
- var color = splitArea.color,
- style = splitArea.style;
- style = _objectSpread({
- fill: 'rgba(0, 0, 0, 0)'
- }, style);
- var lineWidth = ringRadius[0] - 0;
-
- if (polygon) {
- var point1 = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([ringRadius[0], axisLineAngles[0]]));
-
- var point2 = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([ringRadius[0], axisLineAngles[1]]));
-
- lineWidth = (0, util$1.getPointToLineDistance)(centerPos, point1, point2);
- }
-
- style = (0, util$1.deepMerge)((0, util.deepClone)(style, true), {
- lineWidth: lineWidth
- });
- if (!color.length) return style;
- var colorNum = color.length;
- return (0, util$1.deepMerge)(style, {
- stroke: color[i % colorNum]
- });
- }
-
- function beforeUpdateSplitArea(graphs, radarAxis, i, updater) {
- var cache = graphs[i];
- if (!cache) return;
- var render = updater.chart.render;
- var polygon = radarAxis.polygon;
- var name = cache[0].name;
- var currentName = polygon ? 'regPolygon' : 'ring';
- var delAll = currentName !== name;
- if (!delAll) return;
- cache.forEach(function (g) {
- return render.delGraph(g);
- });
- graphs[i] = null;
- }
-
- function beforeChangeSplitArea(graph, config) {
- var side = config.shape.side;
- if (typeof side !== 'number') return;
- graph.shape.side = side;
- }
-
- function getSplitLineConfig(radarAxis) {
- var ringRadius = radarAxis.ringRadius,
- polygon = radarAxis.polygon,
- animationCurve = radarAxis.animationCurve,
- animationFrame = radarAxis.animationFrame,
- rLevel = radarAxis.rLevel;
- var name = polygon ? 'regPolygon' : 'ring';
- return ringRadius.map(function (foo, i) {
- return {
- name: name,
- index: rLevel,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- visible: radarAxis.splitLine.show,
- shape: getSplitLineShape(radarAxis, i),
- style: getSplitLineStyle(radarAxis, i)
- };
- });
- }
-
- function getSplitLineShape(radarAxis, i) {
- var ringRadius = radarAxis.ringRadius,
- centerPos = radarAxis.centerPos,
- indicator = radarAxis.indicator,
- polygon = radarAxis.polygon;
- var shape = {
- rx: centerPos[0],
- ry: centerPos[1],
- r: ringRadius[i]
- };
- var indicatorNum = indicator.length;
- if (polygon) shape.side = indicatorNum;
- return shape;
- }
-
- function getSplitLineStyle(radarAxis, i) {
- var splitLine = radarAxis.splitLine;
- var color = splitLine.color,
- style = splitLine.style;
- style = _objectSpread({
- fill: 'rgba(0, 0, 0, 0)'
- }, style);
- if (!color.length) return style;
- var colorNum = color.length;
- return (0, util$1.deepMerge)(style, {
- stroke: color[i % colorNum]
- });
- }
-
- function beforeUpdateSplitLine(graphs, radarAxis, i, updater) {
- var cache = graphs[i];
- if (!cache) return;
- var render = updater.chart.render;
- var polygon = radarAxis.polygon;
- var name = cache[0].name;
- var currenName = polygon ? 'regPolygon' : 'ring';
- var delAll = currenName !== name;
- if (!delAll) return;
- cache.forEach(function (g) {
- return render.delGraph(g);
- });
- graphs[i] = null;
- }
-
- function beforeChangeSplitLine(graph, config) {
- var side = config.shape.side;
- if (typeof side !== 'number') return;
- graph.shape.side = side;
- }
-
- function getAxisLineConfig(radarAxis) {
- var axisLinePosition = radarAxis.axisLinePosition,
- animationCurve = radarAxis.animationCurve,
- animationFrame = radarAxis.animationFrame,
- rLevel = radarAxis.rLevel;
- return axisLinePosition.map(function (foo, i) {
- return {
- name: 'polyline',
- index: rLevel,
- visible: radarAxis.axisLine.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getAxisLineShape(radarAxis, i),
- style: getAxisLineStyle(radarAxis, i)
- };
- });
- }
-
- function getAxisLineShape(radarAxis, i) {
- var centerPos = radarAxis.centerPos,
- axisLinePosition = radarAxis.axisLinePosition;
- var points = [centerPos, axisLinePosition[i]];
- return {
- points: points
- };
- }
-
- function getAxisLineStyle(radarAxis, i) {
- var axisLine = radarAxis.axisLine;
- var color = axisLine.color,
- style = axisLine.style;
- if (!color.length) return style;
- var colorNum = color.length;
- return (0, util$1.deepMerge)(style, {
- stroke: color[i % colorNum]
- });
- }
-
- function getAxisLabelConfig(radarAxis) {
- var axisLabelPosition = radarAxis.axisLabelPosition,
- animationCurve = radarAxis.animationCurve,
- animationFrame = radarAxis.animationFrame,
- rLevel = radarAxis.rLevel;
- return axisLabelPosition.map(function (foo, i) {
- return {
- name: 'text',
- index: rLevel,
- visible: radarAxis.axisLabel.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getAxisLableShape(radarAxis, i),
- style: getAxisLableStyle(radarAxis, i)
- };
- });
- }
-
- function getAxisLableShape(radarAxis, i) {
- var axisLabelPosition = radarAxis.axisLabelPosition,
- indicator = radarAxis.indicator;
- return {
- content: indicator[i].name,
- position: axisLabelPosition[i]
- };
- }
-
- function getAxisLableStyle(radarAxis, i) {
- var axisLabel = radarAxis.axisLabel,
- _radarAxis$centerPos = (0, _slicedToArray2["default"])(radarAxis.centerPos, 2),
- x = _radarAxis$centerPos[0],
- y = _radarAxis$centerPos[1],
- axisLabelPosition = radarAxis.axisLabelPosition;
-
- var color = axisLabel.color,
- style = axisLabel.style;
-
- var _axisLabelPosition$i = (0, _slicedToArray2["default"])(axisLabelPosition[i], 2),
- labelXpos = _axisLabelPosition$i[0],
- labelYPos = _axisLabelPosition$i[1];
-
- var textAlign = labelXpos > x ? 'left' : 'right';
- var textBaseline = labelYPos > y ? 'top' : 'bottom';
- style = (0, util$1.deepMerge)({
- textAlign: textAlign,
- textBaseline: textBaseline
- }, style);
- if (!color.length) return style;
- var colorNum = color.length;
- return (0, util$1.deepMerge)(style, {
- fill: color[i % colorNum]
- });
- }
- });
-
- unwrapExports(radarAxis_1$1);
- var radarAxis_2 = radarAxis_1$1.radarAxis;
-
- var radar_1$1 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.radar = radar;
-
- var _defineProperty2 = interopRequireDefault(defineProperty);
-
- var _typeof2 = interopRequireDefault(_typeof_1);
-
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
-
-
-
-
-
-
-
-
-
-
- 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; }
-
- 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; }
-
- function radar(chart) {
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var series = option.series;
- if (!series) series = [];
- var radars = (0, util$1.initNeedSeries)(series, config.radarConfig, 'radar');
- radars = calcRadarPosition(radars, chart);
- radars = calcRadarLabelPosition(radars, chart);
- radars = calcRadarLabelAlign(radars, chart);
- (0, updater_class.doUpdate)({
- chart: chart,
- series: radars,
- key: 'radar',
- getGraphConfig: getRadarConfig,
- getStartGraphConfig: getStartRadarConfig,
- beforeChange: beforeChangeRadar
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: radars,
- key: 'radarPoint',
- getGraphConfig: getPointConfig,
- getStartGraphConfig: getStartPointConfig
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: radars,
- key: 'radarLabel',
- getGraphConfig: getLabelConfig
- });
- }
-
- function calcRadarPosition(radars, chart) {
- var radarAxis = chart.radarAxis;
- if (!radarAxis) return [];
- var indicator = radarAxis.indicator,
- axisLineAngles = radarAxis.axisLineAngles,
- radius = radarAxis.radius,
- centerPos = radarAxis.centerPos;
- radars.forEach(function (radarItem) {
- var data = radarItem.data;
- radarItem.dataRadius = [];
- radarItem.radarPosition = indicator.map(function (_ref, i) {
- var max = _ref.max,
- min = _ref.min;
- var v = data[i];
- if (typeof max !== 'number') max = v;
- if (typeof min !== 'number') min = 0;
- if (typeof v !== 'number') v = min;
- var dataRadius = (v - min) / (max - min) * radius;
- radarItem.dataRadius[i] = dataRadius;
- return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([dataRadius, axisLineAngles[i]]));
- });
- });
- return radars;
- }
-
- function calcRadarLabelPosition(radars, chart) {
- var radarAxis = chart.radarAxis;
- if (!radarAxis) return [];
- var centerPos = radarAxis.centerPos,
- axisLineAngles = radarAxis.axisLineAngles;
- radars.forEach(function (radarItem) {
- var dataRadius = radarItem.dataRadius,
- label = radarItem.label;
- var labelGap = label.labelGap;
- radarItem.labelPosition = dataRadius.map(function (r, i) {
- return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(centerPos).concat([r + labelGap, axisLineAngles[i]]));
- });
- });
- return radars;
- }
-
- function calcRadarLabelAlign(radars, chart) {
- var radarAxis = chart.radarAxis;
- if (!radarAxis) return [];
-
- var _radarAxis$centerPos = (0, _slicedToArray2["default"])(radarAxis.centerPos, 2),
- x = _radarAxis$centerPos[0],
- y = _radarAxis$centerPos[1];
-
- radars.forEach(function (radarItem) {
- var labelPosition = radarItem.labelPosition;
- var labelAlign = labelPosition.map(function (_ref2) {
- var _ref3 = (0, _slicedToArray2["default"])(_ref2, 2),
- lx = _ref3[0],
- ly = _ref3[1];
-
- var textAlign = lx > x ? 'left' : 'right';
- var textBaseline = ly > y ? 'top' : 'bottom';
- return {
- textAlign: textAlign,
- textBaseline: textBaseline
- };
- });
- radarItem.labelAlign = labelAlign;
- });
- return radars;
- }
-
- function getRadarConfig(radarItem) {
- var animationCurve = radarItem.animationCurve,
- animationFrame = radarItem.animationFrame,
- rLevel = radarItem.rLevel;
- return [{
- name: 'polyline',
- index: rLevel,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getRadarShape(radarItem),
- style: getRadarStyle(radarItem)
- }];
- }
-
- function getStartRadarConfig(radarItem, updater) {
- var centerPos = updater.chart.radarAxis.centerPos;
- var config = getRadarConfig(radarItem)[0];
- var pointNum = config.shape.points.length;
- var points = new Array(pointNum).fill(0).map(function (foo) {
- return (0, _toConsumableArray2["default"])(centerPos);
- });
- config.shape.points = points;
- return [config];
- }
-
- function getRadarShape(radarItem) {
- var radarPosition = radarItem.radarPosition;
- return {
- points: radarPosition,
- close: true
- };
- }
-
- function getRadarStyle(radarItem) {
- var radarStyle = radarItem.radarStyle,
- color = radarItem.color;
- var colorRgbaValue = (0, lib.getRgbaValue)(color);
- colorRgbaValue[3] = 0.5;
- var radarDefaultColor = {
- stroke: color,
- fill: (0, lib.getColorFromRgbValue)(colorRgbaValue)
- };
- return (0, util$1.deepMerge)(radarDefaultColor, radarStyle);
- }
-
- function beforeChangeRadar(graph, _ref4) {
- var shape = _ref4.shape;
- var graphPoints = graph.shape.points;
- var graphPointsNum = graphPoints.length;
- var pointsNum = shape.points.length;
-
- if (pointsNum > graphPointsNum) {
- var lastPoint = graphPoints.slice(-1)[0];
- var newAddPoints = new Array(pointsNum - graphPointsNum).fill(0).map(function (foo) {
- return (0, _toConsumableArray2["default"])(lastPoint);
- });
- graphPoints.push.apply(graphPoints, (0, _toConsumableArray2["default"])(newAddPoints));
- } else if (pointsNum < graphPointsNum) {
- graphPoints.splice(pointsNum);
- }
- }
-
- function getPointConfig(radarItem) {
- var radarPosition = radarItem.radarPosition,
- animationCurve = radarItem.animationCurve,
- animationFrame = radarItem.animationFrame,
- rLevel = radarItem.rLevel;
- return radarPosition.map(function (foo, i) {
- return {
- name: 'circle',
- index: rLevel,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- visible: radarItem.point.show,
- shape: getPointShape(radarItem, i),
- style: getPointStyle(radarItem)
- };
- });
- }
-
- function getStartPointConfig(radarItem) {
- var configs = getPointConfig(radarItem);
- configs.forEach(function (config) {
- return config.shape.r = 0.01;
- });
- return configs;
- }
-
- function getPointShape(radarItem, i) {
- var radarPosition = radarItem.radarPosition,
- point = radarItem.point;
- var radius = point.radius;
- var position = radarPosition[i];
- return {
- rx: position[0],
- ry: position[1],
- r: radius
- };
- }
-
- function getPointStyle(radarItem, i) {
- var point = radarItem.point,
- color = radarItem.color;
- var style = point.style;
- return (0, util$1.deepMerge)({
- stroke: color
- }, style);
- }
-
- function getLabelConfig(radarItem) {
- var labelPosition = radarItem.labelPosition,
- animationCurve = radarItem.animationCurve,
- animationFrame = radarItem.animationFrame,
- rLevel = radarItem.rLevel;
- return labelPosition.map(function (foo, i) {
- return {
- name: 'text',
- index: rLevel,
- visible: radarItem.label.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getLabelShape(radarItem, i),
- style: getLabelStyle(radarItem, i)
- };
- });
- }
-
- function getLabelShape(radarItem, i) {
- var labelPosition = radarItem.labelPosition,
- label = radarItem.label,
- data = radarItem.data;
- var offset = label.offset,
- formatter = label.formatter;
- var position = mergePointOffset(labelPosition[i], offset);
- var labelText = data[i] ? data[i].toString() : '0';
- var formatterType = (0, _typeof2["default"])(formatter);
- if (formatterType === 'string') labelText = formatter.replace('{value}', labelText);
- if (formatterType === 'function') labelText = formatter(labelText);
- return {
- content: labelText,
- position: position
- };
- }
-
- function mergePointOffset(_ref5, _ref6) {
- var _ref7 = (0, _slicedToArray2["default"])(_ref5, 2),
- x = _ref7[0],
- y = _ref7[1];
-
- var _ref8 = (0, _slicedToArray2["default"])(_ref6, 2),
- ox = _ref8[0],
- oy = _ref8[1];
-
- return [x + ox, y + oy];
- }
-
- function getLabelStyle(radarItem, i) {
- var label = radarItem.label,
- color = radarItem.color,
- labelAlign = radarItem.labelAlign;
- var style = label.style;
-
- var defaultColorAndAlign = _objectSpread({
- fill: color
- }, labelAlign[i]);
-
- return (0, util$1.deepMerge)(defaultColorAndAlign, style);
- }
- });
-
- unwrapExports(radar_1$1);
- var radar_2 = radar_1$1.radar;
-
- var gauge_1$1 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.gauge = gauge$1;
-
- var _defineProperty2 = interopRequireDefault(defineProperty);
-
- var _typeof2 = interopRequireDefault(_typeof_1);
-
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
-
- var _toConsumableArray2 = interopRequireDefault(toConsumableArray);
-
-
-
-
-
-
-
-
-
-
-
- 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; }
-
- 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; }
-
- function gauge$1(chart) {
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var series = option.series;
- if (!series) series = [];
- var gauges = (0, util$1.initNeedSeries)(series, gauge.gaugeConfig, 'gauge');
- gauges = calcGaugesCenter(gauges, chart);
- gauges = calcGaugesRadius(gauges, chart);
- gauges = calcGaugesDataRadiusAndLineWidth(gauges, chart);
- gauges = calcGaugesDataAngles(gauges);
- gauges = calcGaugesDataGradient(gauges);
- gauges = calcGaugesAxisTickPosition(gauges);
- gauges = calcGaugesLabelPositionAndAlign(gauges);
- gauges = calcGaugesLabelData(gauges);
- gauges = calcGaugesDetailsPosition(gauges);
- gauges = calcGaugesDetailsContent(gauges);
- (0, updater_class.doUpdate)({
- chart: chart,
- series: gauges,
- key: 'gaugeAxisTick',
- getGraphConfig: getAxisTickConfig
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: gauges,
- key: 'gaugeAxisLabel',
- getGraphConfig: getAxisLabelConfig
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: gauges,
- key: 'gaugeBackgroundArc',
- getGraphConfig: getBackgroundArcConfig,
- getStartGraphConfig: getStartBackgroundArcConfig
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: gauges,
- key: 'gaugeArc',
- getGraphConfig: getArcConfig,
- getStartGraphConfig: getStartArcConfig,
- beforeChange: beforeChangeArc
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: gauges,
- key: 'gaugePointer',
- getGraphConfig: getPointerConfig,
- getStartGraphConfig: getStartPointerConfig
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: gauges,
- key: 'gaugeDetails',
- getGraphConfig: getDetailsConfig
- });
- }
-
- function calcGaugesCenter(gauges, chart) {
- var area = chart.render.area;
- gauges.forEach(function (gaugeItem) {
- var center = gaugeItem.center;
- center = center.map(function (pos, i) {
- if (typeof pos === 'number') return pos;
- return parseInt(pos) / 100 * area[i];
- });
- gaugeItem.center = center;
- });
- return gauges;
- }
-
- function calcGaugesRadius(gauges, chart) {
- var area = chart.render.area;
- var maxRadius = Math.min.apply(Math, (0, _toConsumableArray2["default"])(area)) / 2;
- gauges.forEach(function (gaugeItem) {
- var radius = gaugeItem.radius;
-
- if (typeof radius !== 'number') {
- radius = parseInt(radius) / 100 * maxRadius;
- }
-
- gaugeItem.radius = radius;
- });
- return gauges;
- }
-
- function calcGaugesDataRadiusAndLineWidth(gauges, chart) {
- var area = chart.render.area;
- var maxRadius = Math.min.apply(Math, (0, _toConsumableArray2["default"])(area)) / 2;
- gauges.forEach(function (gaugeItem) {
- var radius = gaugeItem.radius,
- data = gaugeItem.data,
- arcLineWidth = gaugeItem.arcLineWidth;
- data.forEach(function (item) {
- var arcRadius = item.radius,
- lineWidth = item.lineWidth;
- if (!arcRadius) arcRadius = radius;
- if (typeof arcRadius !== 'number') arcRadius = parseInt(arcRadius) / 100 * maxRadius;
- item.radius = arcRadius;
- if (!lineWidth) lineWidth = arcLineWidth;
- item.lineWidth = lineWidth;
- });
- });
- return gauges;
- }
-
- function calcGaugesDataAngles(gauges, chart) {
- gauges.forEach(function (gaugeItem) {
- var startAngle = gaugeItem.startAngle,
- endAngle = gaugeItem.endAngle,
- data = gaugeItem.data,
- min = gaugeItem.min,
- max = gaugeItem.max;
- var angleMinus = endAngle - startAngle;
- var valueMinus = max - min;
- data.forEach(function (item) {
- var value = item.value;
- var itemAngle = Math.abs((value - min) / valueMinus * angleMinus);
- item.startAngle = startAngle;
- item.endAngle = startAngle + itemAngle;
- });
- });
- return gauges;
- }
-
- function calcGaugesDataGradient(gauges, chart) {
- gauges.forEach(function (gaugeItem) {
- var data = gaugeItem.data;
- data.forEach(function (item) {
- var color = item.color,
- gradient = item.gradient;
- if (!gradient || !gradient.length) gradient = color;
- if (!(gradient instanceof Array)) gradient = [gradient];
- item.gradient = gradient;
- });
- });
- return gauges;
- }
-
- function calcGaugesAxisTickPosition(gauges, chart) {
- gauges.forEach(function (gaugeItem) {
- var startAngle = gaugeItem.startAngle,
- endAngle = gaugeItem.endAngle,
- splitNum = gaugeItem.splitNum,
- center = gaugeItem.center,
- radius = gaugeItem.radius,
- arcLineWidth = gaugeItem.arcLineWidth,
- axisTick = gaugeItem.axisTick;
- var tickLength = axisTick.tickLength,
- lineWidth = axisTick.style.lineWidth;
- var angles = endAngle - startAngle;
- var outerRadius = radius - arcLineWidth / 2;
- var innerRadius = outerRadius - tickLength;
- var angleGap = angles / (splitNum - 1);
- var arcLength = 2 * Math.PI * radius * angles / (Math.PI * 2);
- var offset = Math.ceil(lineWidth / 2) / arcLength * angles;
- gaugeItem.tickAngles = [];
- gaugeItem.tickInnerRadius = [];
- gaugeItem.tickPosition = new Array(splitNum).fill(0).map(function (foo, i) {
- var angle = startAngle + angleGap * i;
- if (i === 0) angle += offset;
- if (i === splitNum - 1) angle -= offset;
- gaugeItem.tickAngles[i] = angle;
- gaugeItem.tickInnerRadius[i] = innerRadius;
- 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]))];
- });
- });
- return gauges;
- }
-
- function calcGaugesLabelPositionAndAlign(gauges, chart) {
- gauges.forEach(function (gaugeItem) {
- var center = gaugeItem.center,
- tickInnerRadius = gaugeItem.tickInnerRadius,
- tickAngles = gaugeItem.tickAngles,
- labelGap = gaugeItem.axisLabel.labelGap;
- var position = tickAngles.map(function (angle, i) {
- return util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([tickInnerRadius[i] - labelGap, tickAngles[i]]));
- });
- var align = position.map(function (_ref) {
- var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
- x = _ref2[0],
- y = _ref2[1];
-
- return {
- textAlign: x > center[0] ? 'right' : 'left',
- textBaseline: y > center[1] ? 'bottom' : 'top'
- };
- });
- gaugeItem.labelPosition = position;
- gaugeItem.labelAlign = align;
- });
- return gauges;
- }
-
- function calcGaugesLabelData(gauges, chart) {
- gauges.forEach(function (gaugeItem) {
- var axisLabel = gaugeItem.axisLabel,
- min = gaugeItem.min,
- max = gaugeItem.max,
- splitNum = gaugeItem.splitNum;
- var data = axisLabel.data,
- formatter = axisLabel.formatter;
- var valueGap = (max - min) / (splitNum - 1);
- var value = new Array(splitNum).fill(0).map(function (foo, i) {
- return parseInt(min + valueGap * i);
- });
- var formatterType = (0, _typeof2["default"])(formatter);
- data = (0, util$1.deepMerge)(value, data).map(function (v, i) {
- var label = v;
-
- if (formatterType === 'string') {
- label = formatter.replace('{value}', v);
- }
-
- if (formatterType === 'function') {
- label = formatter({
- value: v,
- index: i
- });
- }
-
- return label;
- });
- axisLabel.data = data;
- });
- return gauges;
- }
-
- function calcGaugesDetailsPosition(gauges, chart) {
- gauges.forEach(function (gaugeItem) {
- var data = gaugeItem.data,
- details = gaugeItem.details,
- center = gaugeItem.center;
- var position = details.position,
- offset = details.offset;
- var detailsPosition = data.map(function (_ref3) {
- var startAngle = _ref3.startAngle,
- endAngle = _ref3.endAngle,
- radius = _ref3.radius;
- var point = null;
-
- if (position === 'center') {
- point = center;
- } else if (position === 'start') {
- point = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([radius, startAngle]));
- } else if (position === 'end') {
- point = util.getCircleRadianPoint.apply(void 0, (0, _toConsumableArray2["default"])(center).concat([radius, endAngle]));
- }
-
- return getOffsetedPoint(point, offset);
- });
- gaugeItem.detailsPosition = detailsPosition;
- });
- return gauges;
- }
-
- function calcGaugesDetailsContent(gauges, chart) {
- gauges.forEach(function (gaugeItem) {
- var data = gaugeItem.data,
- details = gaugeItem.details;
- var formatter = details.formatter;
- var formatterType = (0, _typeof2["default"])(formatter);
- var contents = data.map(function (dataItem) {
- var content = dataItem.value;
-
- if (formatterType === 'string') {
- content = formatter.replace('{value}', '{nt}');
- content = content.replace('{name}', dataItem.name);
- }
-
- if (formatterType === 'function') content = formatter(dataItem);
- return content.toString();
- });
- gaugeItem.detailsContent = contents;
- });
- return gauges;
- }
-
- function getOffsetedPoint(_ref4, _ref5) {
- var _ref6 = (0, _slicedToArray2["default"])(_ref4, 2),
- x = _ref6[0],
- y = _ref6[1];
-
- var _ref7 = (0, _slicedToArray2["default"])(_ref5, 2),
- ox = _ref7[0],
- oy = _ref7[1];
-
- return [x + ox, y + oy];
- }
-
- function getAxisTickConfig(gaugeItem) {
- var tickPosition = gaugeItem.tickPosition,
- animationCurve = gaugeItem.animationCurve,
- animationFrame = gaugeItem.animationFrame,
- rLevel = gaugeItem.rLevel;
- return tickPosition.map(function (foo, i) {
- return {
- name: 'polyline',
- index: rLevel,
- visible: gaugeItem.axisTick.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getAxisTickShape(gaugeItem, i),
- style: getAxisTickStyle(gaugeItem)
- };
- });
- }
-
- function getAxisTickShape(gaugeItem, i) {
- var tickPosition = gaugeItem.tickPosition;
- return {
- points: tickPosition[i]
- };
- }
-
- function getAxisTickStyle(gaugeItem, i) {
- var style = gaugeItem.axisTick.style;
- return style;
- }
-
- function getAxisLabelConfig(gaugeItem) {
- var labelPosition = gaugeItem.labelPosition,
- animationCurve = gaugeItem.animationCurve,
- animationFrame = gaugeItem.animationFrame,
- rLevel = gaugeItem.rLevel;
- return labelPosition.map(function (foo, i) {
- return {
- name: 'text',
- index: rLevel,
- visible: gaugeItem.axisLabel.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getAxisLabelShape(gaugeItem, i),
- style: getAxisLabelStyle(gaugeItem, i)
- };
- });
- }
-
- function getAxisLabelShape(gaugeItem, i) {
- var labelPosition = gaugeItem.labelPosition,
- data = gaugeItem.axisLabel.data;
- return {
- content: data[i].toString(),
- position: labelPosition[i]
- };
- }
-
- function getAxisLabelStyle(gaugeItem, i) {
- var labelAlign = gaugeItem.labelAlign,
- axisLabel = gaugeItem.axisLabel;
- var style = axisLabel.style;
- return (0, util$1.deepMerge)(_objectSpread({}, labelAlign[i]), style);
- }
-
- function getBackgroundArcConfig(gaugeItem) {
- var animationCurve = gaugeItem.animationCurve,
- animationFrame = gaugeItem.animationFrame,
- rLevel = gaugeItem.rLevel;
- return [{
- name: 'arc',
- index: rLevel,
- visible: gaugeItem.backgroundArc.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getGaugeBackgroundArcShape(gaugeItem),
- style: getGaugeBackgroundArcStyle(gaugeItem)
- }];
- }
-
- function getGaugeBackgroundArcShape(gaugeItem) {
- var startAngle = gaugeItem.startAngle,
- endAngle = gaugeItem.endAngle,
- center = gaugeItem.center,
- radius = gaugeItem.radius;
- return {
- rx: center[0],
- ry: center[1],
- r: radius,
- startAngle: startAngle,
- endAngle: endAngle
- };
- }
-
- function getGaugeBackgroundArcStyle(gaugeItem) {
- var backgroundArc = gaugeItem.backgroundArc,
- arcLineWidth = gaugeItem.arcLineWidth;
- var style = backgroundArc.style;
- return (0, util$1.deepMerge)({
- lineWidth: arcLineWidth
- }, style);
- }
-
- function getStartBackgroundArcConfig(gaugeItem) {
- var config = getBackgroundArcConfig(gaugeItem)[0];
-
- var shape = _objectSpread({}, config.shape);
-
- shape.endAngle = config.shape.startAngle;
- config.shape = shape;
- return [config];
- }
-
- function getArcConfig(gaugeItem) {
- var data = gaugeItem.data,
- animationCurve = gaugeItem.animationCurve,
- animationFrame = gaugeItem.animationFrame,
- rLevel = gaugeItem.rLevel;
- return data.map(function (foo, i) {
- return {
- name: 'agArc',
- index: rLevel,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getGaugeArcShape(gaugeItem, i),
- style: getGaugeArcStyle(gaugeItem, i)
- };
- });
- }
-
- function getGaugeArcShape(gaugeItem, i) {
- var data = gaugeItem.data,
- center = gaugeItem.center,
- gradientEndAngle = gaugeItem.endAngle;
- var _data$i = data[i],
- radius = _data$i.radius,
- startAngle = _data$i.startAngle,
- endAngle = _data$i.endAngle,
- localGradient = _data$i.localGradient;
- if (localGradient) gradientEndAngle = endAngle;
- return {
- rx: center[0],
- ry: center[1],
- r: radius,
- startAngle: startAngle,
- endAngle: endAngle,
- gradientEndAngle: gradientEndAngle
- };
- }
-
- function getGaugeArcStyle(gaugeItem, i) {
- var data = gaugeItem.data,
- dataItemStyle = gaugeItem.dataItemStyle;
- var _data$i2 = data[i],
- lineWidth = _data$i2.lineWidth,
- gradient = _data$i2.gradient;
- gradient = gradient.map(function (c) {
- return (0, lib.getRgbaValue)(c);
- });
- return (0, util$1.deepMerge)({
- lineWidth: lineWidth,
- gradient: gradient
- }, dataItemStyle);
- }
-
- function getStartArcConfig(gaugeItem) {
- var configs = getArcConfig(gaugeItem);
- configs.map(function (config) {
- var shape = _objectSpread({}, config.shape);
-
- shape.endAngle = config.shape.startAngle;
- config.shape = shape;
- });
- return configs;
- }
-
- function beforeChangeArc(graph, config) {
- var graphGradient = graph.style.gradient;
- var cacheNum = graphGradient.length;
- var needNum = config.style.gradient.length;
-
- if (cacheNum > needNum) {
- graphGradient.splice(needNum);
- } else {
- var last = graphGradient.slice(-1)[0];
- graphGradient.push.apply(graphGradient, (0, _toConsumableArray2["default"])(new Array(needNum - cacheNum).fill(0).map(function (foo) {
- return (0, _toConsumableArray2["default"])(last);
- })));
- }
- }
-
- function getPointerConfig(gaugeItem) {
- var animationCurve = gaugeItem.animationCurve,
- animationFrame = gaugeItem.animationFrame,
- center = gaugeItem.center,
- rLevel = gaugeItem.rLevel;
- return [{
- name: 'polyline',
- index: rLevel,
- visible: gaugeItem.pointer.show,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getPointerShape(gaugeItem),
- style: getPointerStyle(gaugeItem),
- setGraphCenter: function setGraphCenter(foo, graph) {
- graph.style.graphCenter = center;
- }
- }];
- }
-
- function getPointerShape(gaugeItem) {
- var center = gaugeItem.center;
- return {
- points: getPointerPoints(center),
- close: true
- };
- }
-
- function getPointerStyle(gaugeItem) {
- var startAngle = gaugeItem.startAngle,
- endAngle = gaugeItem.endAngle,
- min = gaugeItem.min,
- max = gaugeItem.max,
- data = gaugeItem.data,
- pointer = gaugeItem.pointer,
- center = gaugeItem.center;
- var valueIndex = pointer.valueIndex,
- style = pointer.style;
- var value = data[valueIndex] ? data[valueIndex].value : 0;
- var angle = (value - min) / (max - min) * (endAngle - startAngle) + startAngle + Math.PI / 2;
- return (0, util$1.deepMerge)({
- rotate: (0, util$1.radianToAngle)(angle),
- scale: [1, 1],
- graphCenter: center
- }, style);
- }
-
- function getPointerPoints(_ref8) {
- var _ref9 = (0, _slicedToArray2["default"])(_ref8, 2),
- x = _ref9[0],
- y = _ref9[1];
-
- var point1 = [x, y - 40];
- var point2 = [x + 5, y];
- var point3 = [x, y + 10];
- var point4 = [x - 5, y];
- return [point1, point2, point3, point4];
- }
-
- function getStartPointerConfig(gaugeItem) {
- var startAngle = gaugeItem.startAngle;
- var config = getPointerConfig(gaugeItem)[0];
- config.style.rotate = (0, util$1.radianToAngle)(startAngle + Math.PI / 2);
- return [config];
- }
-
- function getDetailsConfig(gaugeItem) {
- var detailsPosition = gaugeItem.detailsPosition,
- animationCurve = gaugeItem.animationCurve,
- animationFrame = gaugeItem.animationFrame,
- rLevel = gaugeItem.rLevel;
- var visible = gaugeItem.details.show;
- return detailsPosition.map(function (foo, i) {
- return {
- name: 'numberText',
- index: rLevel,
- visible: visible,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getDetailsShape(gaugeItem, i),
- style: getDetailsStyle(gaugeItem, i)
- };
- });
- }
-
- function getDetailsShape(gaugeItem, i) {
- var detailsPosition = gaugeItem.detailsPosition,
- detailsContent = gaugeItem.detailsContent,
- data = gaugeItem.data,
- details = gaugeItem.details;
- var position = detailsPosition[i];
- var content = detailsContent[i];
- var dataValue = data[i].value;
- var toFixed = details.valueToFixed;
- return {
- number: [dataValue],
- content: content,
- position: position,
- toFixed: toFixed
- };
- }
-
- function getDetailsStyle(gaugeItem, i) {
- var details = gaugeItem.details,
- data = gaugeItem.data;
- var style = details.style;
- var color = data[i].color;
- return (0, util$1.deepMerge)({
- fill: color
- }, style);
- }
- });
-
- unwrapExports(gauge_1$1);
- var gauge_2 = gauge_1$1.gauge;
-
- var legend_1$1 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.legend = legend;
-
- var _defineProperty2 = interopRequireDefault(defineProperty);
-
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
-
- var _typeof2 = interopRequireDefault(_typeof_1);
-
-
-
-
-
-
-
-
-
- function legend(chart) {
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var legend = option.legend;
-
- if (legend) {
- legend = (0, util$1.deepMerge)((0, util.deepClone)(config.legendConfig, true), legend);
- legend = initLegendData(legend);
- legend = filterInvalidData(legend, option, chart);
- legend = calcLegendTextWidth(legend, chart);
- legend = calcLegendPosition(legend, chart);
- legend = [legend];
- } else {
- legend = [];
- }
-
- (0, updater_class.doUpdate)({
- chart: chart,
- series: legend,
- key: 'legendIcon',
- getGraphConfig: getIconConfig
- });
- (0, updater_class.doUpdate)({
- chart: chart,
- series: legend,
- key: 'legendText',
- getGraphConfig: getTextConfig
- });
- }
-
- function initLegendData(legend) {
- var data = legend.data;
- legend.data = data.map(function (item) {
- var itemType = (0, _typeof2["default"])(item);
-
- if (itemType === 'string') {
- return {
- name: item
- };
- } else if (itemType === 'object') {
- return item;
- }
-
- return {
- name: ''
- };
- });
- return legend;
- }
-
- function filterInvalidData(legend, option, chart) {
- var series = option.series;
- var legendStatus = chart.legendStatus;
- var data = legend.data.filter(function (item) {
- var name = item.name;
- var result = series.find(function (_ref) {
- var sn = _ref.name;
- return name === sn;
- });
- if (!result) return false;
- if (!item.color) item.color = result.color;
- if (!item.icon) item.icon = result.type;
- return item;
- });
- if (!legendStatus || legendStatus.length !== legend.data.length) legendStatus = new Array(legend.data.length).fill(true);
- data.forEach(function (item, i) {
- return item.status = legendStatus[i];
- });
- legend.data = data;
- chart.legendStatus = legendStatus;
- return legend;
- }
-
- function calcLegendTextWidth(legend, chart) {
- var ctx = chart.render.ctx;
- var data = legend.data,
- textStyle = legend.textStyle,
- textUnselectedStyle = legend.textUnselectedStyle;
- data.forEach(function (item) {
- var status = item.status,
- name = item.name;
- item.textWidth = getTextWidth(ctx, name, status ? textStyle : textUnselectedStyle);
- });
- return legend;
- }
-
- function getTextWidth(ctx, text, style) {
- ctx.font = getFontConfig(style);
- return ctx.measureText(text).width;
- }
-
- function getFontConfig(style) {
- var fontFamily = style.fontFamily,
- fontSize = style.fontSize;
- return "".concat(fontSize, "px ").concat(fontFamily);
- }
-
- function calcLegendPosition(legend, chart) {
- var orient = legend.orient;
-
- if (orient === 'vertical') {
- calcVerticalPosition(legend, chart);
- } else {
- calcHorizontalPosition(legend, chart);
- }
-
- return legend;
- }
-
- function calcHorizontalPosition(legend, chart) {
- var iconHeight = legend.iconHeight,
- itemGap = legend.itemGap;
- var lines = calcDefaultHorizontalPosition(legend, chart);
- var xOffsets = lines.map(function (line) {
- return getHorizontalXOffset(line, legend, chart);
- });
- var yOffset = getHorizontalYOffset(legend, chart);
- var align = {
- textAlign: 'left',
- textBaseline: 'middle'
- };
- lines.forEach(function (line, i) {
- return line.forEach(function (item) {
- var iconPosition = item.iconPosition,
- textPosition = item.textPosition;
- var xOffset = xOffsets[i];
- var realYOffset = yOffset + i * (itemGap + iconHeight);
- item.iconPosition = mergeOffset(iconPosition, [xOffset, realYOffset]);
- item.textPosition = mergeOffset(textPosition, [xOffset, realYOffset]);
- item.align = align;
- });
- });
- }
-
- function calcDefaultHorizontalPosition(legend, chart) {
- var data = legend.data,
- iconWidth = legend.iconWidth;
- var w = chart.render.area[0];
- var startIndex = 0;
- var lines = [[]];
- data.forEach(function (item, i) {
- var beforeWidth = getBeforeWidth(startIndex, i, legend);
- var endXPos = beforeWidth + iconWidth + 5 + item.textWidth;
-
- if (endXPos >= w) {
- startIndex = i;
- beforeWidth = getBeforeWidth(startIndex, i, legend);
- lines.push([]);
- }
-
- item.iconPosition = [beforeWidth, 0];
- item.textPosition = [beforeWidth + iconWidth + 5, 0];
- lines.slice(-1)[0].push(item);
- });
- return lines;
- }
-
- function getBeforeWidth(startIndex, currentIndex, legend) {
- var data = legend.data,
- iconWidth = legend.iconWidth,
- itemGap = legend.itemGap;
- var beforeItem = data.slice(startIndex, currentIndex);
- return (0, util$1.mulAdd)(beforeItem.map(function (_ref2) {
- var textWidth = _ref2.textWidth;
- return textWidth;
- })) + (currentIndex - startIndex) * (itemGap + 5 + iconWidth);
- }
-
- function getHorizontalXOffset(data, legend, chart) {
- var left = legend.left,
- right = legend.right,
- iconWidth = legend.iconWidth,
- itemGap = legend.itemGap;
- var w = chart.render.area[0];
- var dataNum = data.length;
- var allWidth = (0, util$1.mulAdd)(data.map(function (_ref3) {
- var textWidth = _ref3.textWidth;
- return textWidth;
- })) + dataNum * (5 + iconWidth) + (dataNum - 1) * itemGap;
- var horizontal = [left, right].findIndex(function (pos) {
- return pos !== 'auto';
- });
-
- if (horizontal === -1) {
- return (w - allWidth) / 2;
- } else if (horizontal === 0) {
- if (typeof left === 'number') return left;
- return parseInt(left) / 100 * w;
- } else {
- if (typeof right !== 'number') right = parseInt(right) / 100 * w;
- return w - (allWidth + right);
- }
- }
-
- function getHorizontalYOffset(legend, chart) {
- var top = legend.top,
- bottom = legend.bottom,
- iconHeight = legend.iconHeight;
- var h = chart.render.area[1];
- var vertical = [top, bottom].findIndex(function (pos) {
- return pos !== 'auto';
- });
- var halfIconHeight = iconHeight / 2;
-
- if (vertical === -1) {
- var _chart$gridArea = chart.gridArea,
- y = _chart$gridArea.y,
- height = _chart$gridArea.h;
- return y + height + 45 - halfIconHeight;
- } else if (vertical === 0) {
- if (typeof top === 'number') return top - halfIconHeight;
- return parseInt(top) / 100 * h - halfIconHeight;
- } else {
- if (typeof bottom !== 'number') bottom = parseInt(bottom) / 100 * h;
- return h - bottom - halfIconHeight;
- }
- }
-
- function mergeOffset(_ref4, _ref5) {
- var _ref6 = (0, _slicedToArray2["default"])(_ref4, 2),
- x = _ref6[0],
- y = _ref6[1];
-
- var _ref7 = (0, _slicedToArray2["default"])(_ref5, 2),
- ox = _ref7[0],
- oy = _ref7[1];
-
- return [x + ox, y + oy];
- }
-
- function calcVerticalPosition(legend, chart) {
- var _getVerticalXOffset = getVerticalXOffset(legend, chart),
- _getVerticalXOffset2 = (0, _slicedToArray2["default"])(_getVerticalXOffset, 2),
- isRight = _getVerticalXOffset2[0],
- xOffset = _getVerticalXOffset2[1];
-
- var yOffset = getVerticalYOffset(legend, chart);
- calcDefaultVerticalPosition(legend, isRight);
- var align = {
- textAlign: 'left',
- textBaseline: 'middle'
- };
- legend.data.forEach(function (item) {
- var textPosition = item.textPosition,
- iconPosition = item.iconPosition;
- item.textPosition = mergeOffset(textPosition, [xOffset, yOffset]);
- item.iconPosition = mergeOffset(iconPosition, [xOffset, yOffset]);
- item.align = align;
- });
- }
-
- function getVerticalXOffset(legend, chart) {
- var left = legend.left,
- right = legend.right;
- var w = chart.render.area[0];
- var horizontal = [left, right].findIndex(function (pos) {
- return pos !== 'auto';
- });
-
- if (horizontal === -1) {
- return [true, w - 10];
- } else {
- var offset = [left, right][horizontal];
- if (typeof offset !== 'number') offset = parseInt(offset) / 100 * w;
- return [Boolean(horizontal), offset];
- }
- }
-
- function getVerticalYOffset(legend, chart) {
- var iconHeight = legend.iconHeight,
- itemGap = legend.itemGap,
- data = legend.data,
- top = legend.top,
- bottom = legend.bottom;
- var h = chart.render.area[1];
- var dataNum = data.length;
- var allHeight = dataNum * iconHeight + (dataNum - 1) * itemGap;
- var vertical = [top, bottom].findIndex(function (pos) {
- return pos !== 'auto';
- });
-
- if (vertical === -1) {
- return (h - allHeight) / 2;
- } else {
- var offset = [top, bottom][vertical];
- if (typeof offset !== 'number') offset = parseInt(offset) / 100 * h;
- if (vertical === 1) offset = h - offset - allHeight;
- return offset;
- }
- }
-
- function calcDefaultVerticalPosition(legend, isRight) {
- var data = legend.data,
- iconWidth = legend.iconWidth,
- iconHeight = legend.iconHeight,
- itemGap = legend.itemGap;
- var halfIconHeight = iconHeight / 2;
- data.forEach(function (item, i) {
- var textWidth = item.textWidth;
- var yPos = (iconHeight + itemGap) * i + halfIconHeight;
- var iconXPos = isRight ? 0 - iconWidth : 0;
- var textXpos = isRight ? iconXPos - 5 - textWidth : iconWidth + 5;
- item.iconPosition = [iconXPos, yPos];
- item.textPosition = [textXpos, yPos];
- });
- }
-
- function getIconConfig(legendItem, updater) {
- var data = legendItem.data,
- selectAble = legendItem.selectAble,
- animationCurve = legendItem.animationCurve,
- animationFrame = legendItem.animationFrame,
- rLevel = legendItem.rLevel;
- return data.map(function (item, i) {
- return (0, _defineProperty2["default"])({
- name: item.icon === 'line' ? 'lineIcon' : 'rect',
- index: rLevel,
- visible: legendItem.show,
- hover: selectAble,
- click: selectAble,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- shape: getIconShape(legendItem, i),
- style: getIconStyle(legendItem, i)
- }, "click", createClickCallBack(legendItem, i, updater));
- });
- }
-
- function getIconShape(legendItem, i) {
- var data = legendItem.data,
- iconWidth = legendItem.iconWidth,
- iconHeight = legendItem.iconHeight;
-
- var _data$i$iconPosition = (0, _slicedToArray2["default"])(data[i].iconPosition, 2),
- x = _data$i$iconPosition[0],
- y = _data$i$iconPosition[1];
-
- var halfIconHeight = iconHeight / 2;
- return {
- x: x,
- y: y - halfIconHeight,
- w: iconWidth,
- h: iconHeight
- };
- }
-
- function getIconStyle(legendItem, i) {
- var data = legendItem.data,
- iconStyle = legendItem.iconStyle,
- iconUnselectedStyle = legendItem.iconUnselectedStyle;
- var _data$i = data[i],
- status = _data$i.status,
- color = _data$i.color;
- var style = status ? iconStyle : iconUnselectedStyle;
- return (0, util$1.deepMerge)({
- fill: color
- }, style);
- }
-
- function getTextConfig(legendItem, updater) {
- var data = legendItem.data,
- selectAble = legendItem.selectAble,
- animationCurve = legendItem.animationCurve,
- animationFrame = legendItem.animationFrame,
- rLevel = legendItem.rLevel;
- return data.map(function (foo, i) {
- return {
- name: 'text',
- index: rLevel,
- visible: legendItem.show,
- hover: selectAble,
- animationCurve: animationCurve,
- animationFrame: animationFrame,
- hoverRect: getTextHoverRect(legendItem, i),
- shape: getTextShape(legendItem, i),
- style: getTextStyle(legendItem, i),
- click: createClickCallBack(legendItem, i, updater)
- };
- });
- }
-
- function getTextShape(legendItem, i) {
- var _legendItem$data$i = legendItem.data[i],
- textPosition = _legendItem$data$i.textPosition,
- name = _legendItem$data$i.name;
- return {
- content: name,
- position: textPosition
- };
- }
-
- function getTextStyle(legendItem, i) {
- var textStyle = legendItem.textStyle,
- textUnselectedStyle = legendItem.textUnselectedStyle;
- var _legendItem$data$i2 = legendItem.data[i],
- status = _legendItem$data$i2.status,
- align = _legendItem$data$i2.align;
- var style = status ? textStyle : textUnselectedStyle;
- return (0, util$1.deepMerge)((0, util.deepClone)(style, true), align);
- }
-
- function getTextHoverRect(legendItem, i) {
- var textStyle = legendItem.textStyle,
- textUnselectedStyle = legendItem.textUnselectedStyle;
-
- var _legendItem$data$i3 = legendItem.data[i],
- status = _legendItem$data$i3.status,
- _legendItem$data$i3$t = (0, _slicedToArray2["default"])(_legendItem$data$i3.textPosition, 2),
- x = _legendItem$data$i3$t[0],
- y = _legendItem$data$i3$t[1],
- textWidth = _legendItem$data$i3.textWidth;
-
- var style = status ? textStyle : textUnselectedStyle;
- var fontSize = style.fontSize;
- return [x, y - fontSize / 2, textWidth, fontSize];
- }
-
- function createClickCallBack(legendItem, index, updater) {
- var name = legendItem.data[index].name;
- return function () {
- var _updater$chart = updater.chart,
- legendStatus = _updater$chart.legendStatus,
- option = _updater$chart.option;
- var status = !legendStatus[index];
- var change = option.series.find(function (_ref9) {
- var sn = _ref9.name;
- return sn === name;
- });
- change.show = status;
- legendStatus[index] = status;
- updater.chart.setOption(option);
- };
- }
- });
-
- unwrapExports(legend_1$1);
- var legend_2 = legend_1$1.legend;
-
- var core = createCommonjsModule(function (module, exports) {
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- Object.defineProperty(exports, "mergeColor", {
- enumerable: true,
- get: function get() {
- return mergeColor_1.mergeColor;
- }
- });
- Object.defineProperty(exports, "title", {
- enumerable: true,
- get: function get() {
- return title_1$1.title;
- }
- });
- Object.defineProperty(exports, "grid", {
- enumerable: true,
- get: function get() {
- return grid_1$1.grid;
- }
- });
- Object.defineProperty(exports, "axis", {
- enumerable: true,
- get: function get() {
- return axis_1$1.axis;
- }
- });
- Object.defineProperty(exports, "line", {
- enumerable: true,
- get: function get() {
- return line_1$1.line;
- }
- });
- Object.defineProperty(exports, "bar", {
- enumerable: true,
- get: function get() {
- return bar_1$1.bar;
- }
- });
- Object.defineProperty(exports, "pie", {
- enumerable: true,
- get: function get() {
- return pie_1$1.pie;
- }
- });
- Object.defineProperty(exports, "radarAxis", {
- enumerable: true,
- get: function get() {
- return radarAxis_1$1.radarAxis;
- }
- });
- Object.defineProperty(exports, "radar", {
- enumerable: true,
- get: function get() {
- return radar_1$1.radar;
- }
- });
- Object.defineProperty(exports, "gauge", {
- enumerable: true,
- get: function get() {
- return gauge_1$1.gauge;
- }
- });
- Object.defineProperty(exports, "legend", {
- enumerable: true,
- get: function get() {
- return legend_1$1.legend;
- }
- });
- });
-
- unwrapExports(core);
-
- var charts_class = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
-
- var _typeof2 = interopRequireDefault(_typeof_1);
-
- var _classCallCheck2 = interopRequireDefault(classCallCheck);
-
-
-
- var _cRender = interopRequireDefault(lib$3);
-
-
-
-
-
- var Charts = function Charts(dom) {
- (0, _classCallCheck2["default"])(this, Charts);
-
- if (!dom) {
- console.error('Charts Missing parameters!');
- return false;
- }
-
- var clientWidth = dom.clientWidth,
- clientHeight = dom.clientHeight;
- var canvas = document.createElement('canvas');
- canvas.setAttribute('width', clientWidth);
- canvas.setAttribute('height', clientHeight);
- dom.appendChild(canvas);
- var attribute = {
- container: dom,
- canvas: canvas,
- render: new _cRender["default"](canvas),
- option: null
- };
- Object.assign(this, attribute);
- };
- /**
- * @description Set chart option
- * @param {Object} option Chart option
- * @param {Boolean} animationEnd Execute animationEnd
- * @return {Undefined} No return
- */
-
-
- exports["default"] = Charts;
-
- Charts.prototype.setOption = function (option) {
- var animationEnd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- if (!option || (0, _typeof2["default"])(option) !== 'object') {
- console.error('setOption Missing parameters!');
- return false;
- }
-
- if (animationEnd) this.render.graphs.forEach(function (graph) {
- return graph.animationEnd();
- });
- var optionCloned = (0, util.deepClone)(option, true);
- (0, core.mergeColor)(this, optionCloned);
- (0, core.grid)(this, optionCloned);
- (0, core.axis)(this, optionCloned);
- (0, core.radarAxis)(this, optionCloned);
- (0, core.title)(this, optionCloned);
- (0, core.bar)(this, optionCloned);
- (0, core.line)(this, optionCloned);
- (0, core.pie)(this, optionCloned);
- (0, core.radar)(this, optionCloned);
- (0, core.gauge)(this, optionCloned);
- (0, core.legend)(this, optionCloned);
- this.option = option;
- this.render.launchAnimation(); // console.warn(this)
- };
- /**
- * @description Resize chart
- * @return {Undefined} No return
- */
-
-
- Charts.prototype.resize = function () {
- var container = this.container,
- canvas = this.canvas,
- render = this.render,
- option = this.option;
- var clientWidth = container.clientWidth,
- clientHeight = container.clientHeight;
- canvas.setAttribute('width', clientWidth);
- canvas.setAttribute('height', clientHeight);
- render.area = [clientWidth, clientHeight];
- this.setOption(option);
- };
- });
-
- unwrapExports(charts_class);
-
- var lib$4 = createCommonjsModule(function (module, exports) {
-
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- Object.defineProperty(exports, "changeDefaultConfig", {
- enumerable: true,
- get: function get() {
- return config.changeDefaultConfig;
- }
- });
- exports["default"] = void 0;
-
- var _charts = interopRequireDefault(charts_class);
-
-
-
- var _default = _charts["default"];
- exports["default"] = _default;
- });
-
- var Charts = unwrapExports(lib$4);
-
- //
- var script$r = {
- name: 'DvCharts',
- mixins: [autoResize],
- props: {
- option: {
- type: Object,
- default: () => ({})
- }
- },
-
- data() {
- const id = uuid();
- return {
- ref: `charts-container-${id}`,
- chartRef: `chart-${id}`,
- chart: null
- };
- },
-
- watch: {
- option() {
- let {
- chart,
- option
- } = this;
- if (!chart) return;
- if (!option) option = {};
- chart.setOption(option, true);
- }
-
- },
- methods: {
- afterAutoResizeMixinInit() {
- const {
- initChart
- } = this;
- initChart();
- },
-
- initChart() {
- const {
- $refs,
- chartRef,
- option
- } = this;
- const chart = this.chart = new Charts($refs[chartRef]);
- if (!option) return;
- chart.setOption(option);
- },
-
- onResize() {
- const {
- chart
- } = this;
- if (!chart) return;
- chart.resize();
- }
-
- }
- };
-
- /* script */
- const __vue_script__$r = script$r;
-
- /* template */
- var __vue_render__$r = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-charts-container" }, [
- _c("div", { ref: _vm.chartRef, staticClass: "charts-canvas-container" })
- ])
- };
- var __vue_staticRenderFns__$r = [];
- __vue_render__$r._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$r = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$r = undefined;
- /* module identifier */
- const __vue_module_identifier__$r = undefined;
- /* functional template */
- const __vue_is_functional_template__$r = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$r = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$r, staticRenderFns: __vue_staticRenderFns__$r },
- __vue_inject_styles__$r,
- __vue_script__$r,
- __vue_scope_id__$r,
- __vue_is_functional_template__$r,
- __vue_module_identifier__$r,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function charts (Vue) {
- Vue.component(__vue_component__$r.name, __vue_component__$r);
- }
-
- //
- var script$s = {
- name: 'DvDigitalFlop',
- props: {
- config: {
- type: Object,
- default: () => ({})
- }
- },
-
- data() {
- return {
- renderer: null,
- defaultConfig: {
- /**
- * @description Number for digital flop
- * @type {Array<Number>}
- * @default number = []
- * @example number = [10]
- */
- number: [],
-
- /**
- * @description Content formatter
- * @type {String}
- * @default content = ''
- * @example content = '{nt}个'
- */
- content: '',
-
- /**
- * @description Number toFixed
- * @type {Number}
- * @default toFixed = 0
- */
- toFixed: 0,
-
- /**
- * @description Text align
- * @type {String}
- * @default textAlign = 'center'
- * @example textAlign = 'center' | 'left' | 'right'
- */
- textAlign: 'center',
-
- /**
- * @description rowGap
- * @type {Number}
- @default rowGap = 0
- */
- rowGap: 0,
-
- /**
- * @description Text style configuration
- * @type {Object} {CRender Class Style}
- */
- style: {
- fontSize: 30,
- fill: '#3de7c9'
- },
-
- /**
- * @description Number formatter
- * @type {Null|Function}
- */
- formatter: undefined,
-
- /**
- * @description CRender animationCurve
- * @type {String}
- * @default animationCurve = 'easeOutCubic'
- */
- animationCurve: 'easeOutCubic',
-
- /**
- * @description CRender animationFrame
- * @type {String}
- * @default animationFrame = 50
- */
- animationFrame: 50
- },
- mergedConfig: null,
- graph: null
- };
- },
-
- watch: {
- config() {
- const {
- update
- } = this;
- update();
- }
-
- },
- methods: {
- init() {
- const {
- initRender,
- mergeConfig,
- initGraph
- } = this;
- initRender();
- mergeConfig();
- initGraph();
- },
-
- initRender() {
- const {
- $refs
- } = this;
- this.renderer = new CRender($refs['digital-flop']);
- },
-
- mergeConfig() {
- const {
- defaultConfig,
- config
- } = this;
- this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
- },
-
- initGraph() {
- const {
- getShape,
- getStyle,
- renderer,
- mergedConfig
- } = this;
- const {
- animationCurve,
- animationFrame
- } = mergedConfig;
- const shape = getShape();
- const style = getStyle();
- this.graph = renderer.add({
- name: 'numberText',
- animationCurve,
- animationFrame,
- shape,
- style
- });
- },
-
- getShape() {
- const {
- number,
- content,
- toFixed,
- textAlign,
- rowGap,
- formatter
- } = this.mergedConfig;
- const [w, h] = this.renderer.area;
- const position = [w / 2, h / 2];
- if (textAlign === 'left') position[0] = 0;
- if (textAlign === 'right') position[0] = w;
- return {
- number,
- content,
- toFixed,
- position,
- rowGap,
- formatter
- };
- },
-
- getStyle() {
- const {
- style,
- textAlign
- } = this.mergedConfig;
- return util_2$1(style, {
- textAlign,
- textBaseline: 'middle'
- });
- },
-
- update() {
- const {
- mergeConfig,
- mergeShape,
- getShape,
- getStyle,
- graph,
- mergedConfig
- } = this;
- graph.animationEnd();
- mergeConfig();
- if (!graph) return;
- const {
- animationCurve,
- animationFrame
- } = mergedConfig;
- const shape = getShape();
- const style = getStyle();
- mergeShape(graph, shape);
- graph.animationCurve = animationCurve;
- graph.animationFrame = animationFrame;
- graph.animation('style', style, true);
- graph.animation('shape', shape);
- },
-
- mergeShape(graph, shape) {
- const cacheNum = graph.shape.number.length;
- const shapeNum = shape.number.length;
- if (cacheNum !== shapeNum) graph.shape.number = shape.number;
- }
-
- },
-
- mounted() {
- const {
- init
- } = this;
- init();
- }
-
- };
-
- /* script */
- const __vue_script__$s = script$s;
-
- /* template */
- var __vue_render__$s = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { staticClass: "dv-digital-flop" }, [
- _c("canvas", { ref: "digital-flop" })
- ])
- };
- var __vue_staticRenderFns__$s = [];
- __vue_render__$s._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$s = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$s = undefined;
- /* module identifier */
- const __vue_module_identifier__$s = undefined;
- /* functional template */
- const __vue_is_functional_template__$s = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$s = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$s, staticRenderFns: __vue_staticRenderFns__$s },
- __vue_inject_styles__$s,
- __vue_script__$s,
- __vue_scope_id__$s,
- __vue_is_functional_template__$s,
- __vue_module_identifier__$s,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- //
- var script$t = {
- name: 'DvActiveRingChart',
- components: {
- dvDigitalFlop: __vue_component__$s
- },
- props: {
- config: {
- type: Object,
- default: () => ({})
- }
- },
-
- data() {
- return {
- defaultConfig: {
- /**
- * @description Ring radius
- * @type {String|Number}
- * @default radius = '50%'
- * @example radius = '50%' | 100
- */
- radius: '50%',
-
- /**
- * @description Active ring radius
- * @type {String|Number}
- * @default activeRadius = '55%'
- * @example activeRadius = '55%' | 110
- */
- activeRadius: '55%',
-
- /**
- * @description Ring data
- * @type {Array<Object>}
- * @default data = [{ name: '', value: 0 }]
- */
- data: [{
- name: '',
- value: 0
- }],
-
- /**
- * @description Ring line width
- * @type {Number}
- * @default lineWidth = 20
- */
- lineWidth: 20,
-
- /**
- * @description Active time gap (ms)
- * @type {Number}
- * @default activeTimeGap = 3000
- */
- activeTimeGap: 3000,
-
- /**
- * @description Ring color (hex|rgb|rgba|color keywords)
- * @type {Array<String>}
- * @default color = [Charts Default Color]
- * @example color = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red']
- */
- color: [],
-
- /**
- * @description Digital flop style
- * @type {Object}
- */
- digitalFlopStyle: {
- fontSize: 25,
- fill: '#fff'
- },
-
- /**
- * @description Digital flop toFixed
- * @type {Number}
- */
- digitalFlopToFixed: 0,
-
- /**
- * @description Digital flop unit
- * @type {String}
- */
- digitalFlopUnit: '',
-
- /**
- * @description CRender animationCurve
- * @type {String}
- * @default animationCurve = 'easeOutCubic'
- */
- animationCurve: 'easeOutCubic',
-
- /**
- * @description CRender animationFrame
- * @type {String}
- * @default animationFrame = 50
- */
- animationFrame: 50,
-
- /**
- * @description showOriginValue
- * @type {Boolean}
- * @default showOriginValue = false
- */
- showOriginValue: false
- },
- mergedConfig: null,
- chart: null,
- activeIndex: 0,
- animationHandler: ''
- };
- },
-
- computed: {
- digitalFlop() {
- const {
- mergedConfig,
- activeIndex
- } = this;
- if (!mergedConfig) return {};
- const {
- digitalFlopStyle,
- digitalFlopToFixed,
- data,
- showOriginValue,
- digitalFlopUnit
- } = mergedConfig;
- const value = data.map(({
- value
- }) => value);
- let displayValue;
-
- if (showOriginValue) {
- displayValue = value[activeIndex];
- } else {
- const sum = value.reduce((all, v) => all + v, 0);
- const percent = parseFloat(value[activeIndex] / sum * 100) || 0;
- displayValue = percent;
- }
-
- return {
- content: showOriginValue ? `{nt}${digitalFlopUnit}` : `{nt}${digitalFlopUnit || '%'}`,
- number: [displayValue],
- style: digitalFlopStyle,
- toFixed: digitalFlopToFixed
- };
- },
-
- ringName() {
- const {
- mergedConfig,
- activeIndex
- } = this;
- if (!mergedConfig) return '';
- return mergedConfig.data[activeIndex].name;
- },
-
- fontSize() {
- const {
- mergedConfig
- } = this;
- if (!mergedConfig) return '';
- return `font-size: ${mergedConfig.digitalFlopStyle.fontSize}px;`;
- }
-
- },
- watch: {
- config() {
- const {
- animationHandler,
- mergeConfig,
- setRingOption
- } = this;
- clearTimeout(animationHandler);
- this.activeIndex = 0;
- mergeConfig();
- setRingOption();
- }
-
- },
- methods: {
- init() {
- const {
- initChart,
- mergeConfig,
- setRingOption
- } = this;
- initChart();
- mergeConfig();
- setRingOption();
- },
-
- initChart() {
- const {
- $refs
- } = this;
- this.chart = new Charts($refs['active-ring-chart']);
- },
-
- mergeConfig() {
- const {
- defaultConfig,
- config
- } = this;
- this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
- },
-
- setRingOption() {
- const {
- getRingOption,
- chart,
- ringAnimation
- } = this;
- const option = getRingOption();
- chart.setOption(option, true);
- ringAnimation();
- },
-
- getRingOption() {
- const {
- mergedConfig,
- getRealRadius
- } = this;
- const radius = getRealRadius();
- mergedConfig.data.forEach(dataItem => {
- dataItem.radius = radius;
- });
- return {
- series: [{
- type: 'pie',
- ...mergedConfig,
- outsideLabel: {
- show: false
- }
- }],
- color: mergedConfig.color
- };
- },
-
- getRealRadius(active = false) {
- const {
- mergedConfig,
- chart
- } = this;
- const {
- radius,
- activeRadius,
- lineWidth
- } = mergedConfig;
- const maxRadius = Math.min(...chart.render.area) / 2;
- const halfLineWidth = lineWidth / 2;
- let realRadius = active ? activeRadius : radius;
- if (typeof realRadius !== 'number') realRadius = parseInt(realRadius) / 100 * maxRadius;
- const insideRadius = realRadius - halfLineWidth;
- const outSideRadius = realRadius + halfLineWidth;
- return [insideRadius, outSideRadius];
- },
-
- ringAnimation() {
- let {
- activeIndex,
- getRingOption,
- chart,
- getRealRadius
- } = this;
- const radius = getRealRadius();
- const active = getRealRadius(true);
- const option = getRingOption();
- const {
- data
- } = option.series[0];
- data.forEach((dataItem, i) => {
- if (i === activeIndex) {
- dataItem.radius = active;
- } else {
- dataItem.radius = radius;
- }
- });
- chart.setOption(option, true);
- const {
- activeTimeGap
- } = option.series[0];
- this.animationHandler = setTimeout(foo => {
- activeIndex += 1;
- if (activeIndex >= data.length) activeIndex = 0;
- this.activeIndex = activeIndex;
- this.ringAnimation();
- }, activeTimeGap);
- }
-
- },
-
- mounted() {
- const {
- init
- } = this;
- init();
- },
-
- beforeDestroy() {
- const {
- animationHandler
- } = this;
- clearTimeout(animationHandler);
- }
-
- };
-
- /* script */
- const __vue_script__$t = script$t;
-
- /* template */
- var __vue_render__$t = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { staticClass: "dv-active-ring-chart" }, [
- _c("div", {
- ref: "active-ring-chart",
- staticClass: "active-ring-chart-container"
- }),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "active-ring-info" },
- [
- _c("dv-digital-flop", { attrs: { config: _vm.digitalFlop } }),
- _vm._v(" "),
- _c("div", { staticClass: "active-ring-name", style: _vm.fontSize }, [
- _vm._v(_vm._s(_vm.ringName))
- ])
- ],
- 1
- )
- ])
- };
- var __vue_staticRenderFns__$t = [];
- __vue_render__$t._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$t = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$t = undefined;
- /* module identifier */
- const __vue_module_identifier__$t = undefined;
- /* functional template */
- const __vue_is_functional_template__$t = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$t = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$t, staticRenderFns: __vue_staticRenderFns__$t },
- __vue_inject_styles__$t,
- __vue_script__$t,
- __vue_scope_id__$t,
- __vue_is_functional_template__$t,
- __vue_module_identifier__$t,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function activeRingChart (Vue) {
- Vue.component(__vue_component__$t.name, __vue_component__$t);
- }
-
- //
- var script$u = {
- name: 'DvCapsuleChart',
- props: {
- config: {
- type: Object,
- default: () => ({})
- }
- },
-
- data() {
- return {
- defaultConfig: {
- /**
- * @description Capsule chart data
- * @type {Array<Object>}
- * @default data = []
- * @example data = [{ name: 'foo1', value: 100 }, { name: 'foo2', value: 100 }]
- */
- data: [],
-
- /**
- * @description Colors (hex|rgb|rgba|color keywords)
- * @type {Array<String>}
- * @default color = ['#37a2da', '#32c5e9', '#67e0e3', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293']
- * @example color = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red']
- */
- colors: ['#37a2da', '#32c5e9', '#67e0e3', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293'],
-
- /**
- * @description Chart unit
- * @type {String}
- * @default unit = ''
- */
- unit: '',
-
- /**
- * @description Show item value
- * @type {Boolean}
- * @default showValue = false
- */
- showValue: false
- },
- mergedConfig: null,
- capsuleLength: [],
- capsuleValue: [],
- labelData: [],
- labelDataLength: []
- };
- },
-
- watch: {
- config() {
- const {
- calcData
- } = this;
- calcData();
- }
-
- },
- methods: {
- calcData() {
- const {
- mergeConfig,
- calcCapsuleLengthAndLabelData
- } = this;
- mergeConfig();
- calcCapsuleLengthAndLabelData();
- },
-
- mergeConfig() {
- let {
- config,
- defaultConfig
- } = this;
- this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
- },
-
- calcCapsuleLengthAndLabelData() {
- const {
- data
- } = this.mergedConfig;
- if (!data.length) return;
- const capsuleValue = data.map(({
- value
- }) => value);
- const maxValue = Math.max(...capsuleValue);
- this.capsuleValue = capsuleValue;
- this.capsuleLength = capsuleValue.map(v => maxValue ? v / maxValue : 0);
- const oneFifth = maxValue / 5;
- const labelData = Array.from(new Set(new Array(6).fill(0).map((v, i) => Math.ceil(i * oneFifth))));
- this.labelData = labelData;
- this.labelDataLength = Array.from(labelData).map(v => maxValue ? v / maxValue : 0);
- }
-
- },
-
- mounted() {
- const {
- calcData
- } = this;
- calcData();
- }
-
- };
-
- /* script */
- const __vue_script__$u = script$u;
-
- /* template */
- var __vue_render__$u = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c(
- "div",
- { staticClass: "dv-capsule-chart" },
- [
- _vm.mergedConfig
- ? [
- _c(
- "div",
- { staticClass: "label-column" },
- [
- _vm._l(_vm.mergedConfig.data, function(item) {
- return _c("div", { key: item.name }, [
- _vm._v(_vm._s(item.name))
- ])
- }),
- _vm._v(" "),
- _c("div", [_vm._v(" ")])
- ],
- 2
- ),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "capsule-container" },
- [
- _vm._l(_vm.capsuleLength, function(capsule, index) {
- return _c(
- "div",
- { key: index, staticClass: "capsule-item" },
- [
- _c(
- "div",
- {
- staticClass: "capsule-item-column",
- style:
- "width: " +
- capsule * 100 +
- "%; background-color: " +
- _vm.mergedConfig.colors[
- index % _vm.mergedConfig.colors.length
- ] +
- ";"
- },
- [
- _vm.mergedConfig.showValue
- ? _c("div", { staticClass: "capsule-item-value" }, [
- _vm._v(_vm._s(_vm.capsuleValue[index]))
- ])
- : _vm._e()
- ]
- )
- ]
- )
- }),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "unit-label" },
- _vm._l(_vm.labelData, function(label, index) {
- return _c("div", { key: label + index }, [
- _vm._v(_vm._s(label))
- ])
- }),
- 0
- )
- ],
- 2
- ),
- _vm._v(" "),
- _vm.mergedConfig.unit
- ? _c("div", { staticClass: "unit-text" }, [
- _vm._v(_vm._s(_vm.mergedConfig.unit))
- ])
- : _vm._e()
- ]
- : _vm._e()
- ],
- 2
- )
- };
- var __vue_staticRenderFns__$u = [];
- __vue_render__$u._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$u = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$u = undefined;
- /* module identifier */
- const __vue_module_identifier__$u = undefined;
- /* functional template */
- const __vue_is_functional_template__$u = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$u = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$u, staticRenderFns: __vue_staticRenderFns__$u },
- __vue_inject_styles__$u,
- __vue_script__$u,
- __vue_scope_id__$u,
- __vue_is_functional_template__$u,
- __vue_module_identifier__$u,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function capsuleChart (Vue) {
- Vue.component(__vue_component__$u.name, __vue_component__$u);
- }
-
- //
- var script$v = {
- name: 'DvWaterLevelPond',
- props: {
- config: Object,
- default: () => ({})
- },
-
- data() {
- const id = uuid();
- return {
- gradientId: `water-level-pond-${id}`,
- defaultConfig: {
- /**
- * @description Data
- * @type {Array<Number>}
- * @default data = []
- * @example data = [60, 40]
- */
- data: [],
-
- /**
- * @description Shape of wanter level pond
- * @type {String}
- * @default shape = 'rect'
- * @example shape = 'rect' | 'roundRect' | 'round'
- */
- shape: 'rect',
-
- /**
- * @description Water wave number
- * @type {Number}
- * @default waveNum = 3
- */
- waveNum: 3,
-
- /**
- * @description Water wave height (px)
- * @type {Number}
- * @default waveHeight = 40
- */
- waveHeight: 40,
-
- /**
- * @description Wave opacity
- * @type {Number}
- * @default waveOpacity = 0.4
- */
- waveOpacity: 0.4,
-
- /**
- * @description Colors (hex|rgb|rgba|color keywords)
- * @type {Array<String>}
- * @default colors = ['#00BAFF', '#3DE7C9']
- * @example colors = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red']
- */
- colors: ['#3DE7C9', '#00BAFF'],
-
- /**
- * @description Formatter
- * @type {String}
- * @default formatter = '{value}%'
- */
- formatter: '{value}%'
- },
- mergedConfig: {},
- renderer: null,
- svgBorderGradient: [],
- details: '',
- waves: [],
- animation: false
- };
- },
-
- computed: {
- radius() {
- const {
- shape
- } = this.mergedConfig;
- if (shape === 'round') return '50%';
- if (shape === 'rect') return '0';
- if (shape === 'roundRect') return '10px';
- return '0';
- },
-
- shape() {
- const {
- shape
- } = this.mergedConfig;
- if (!shape) return 'rect';
- return shape;
- }
-
- },
- watch: {
- config() {
- const {
- calcData,
- renderer
- } = this;
- renderer.delAllGraph();
- this.waves = [];
- setTimeout(calcData, 0);
- }
-
- },
- methods: {
- init() {
- const {
- initRender,
- config,
- calcData
- } = this;
- initRender();
- if (!config) return;
- calcData();
- },
-
- initRender() {
- const {
- $refs
- } = this;
- this.renderer = new CRender($refs['water-pond-level']);
- },
-
- calcData() {
- const {
- mergeConfig,
- calcSvgBorderGradient,
- calcDetails
- } = this;
- mergeConfig();
- calcSvgBorderGradient();
- calcDetails();
- const {
- addWave,
- animationWave
- } = this;
- addWave();
- animationWave();
- },
-
- mergeConfig() {
- const {
- config,
- defaultConfig
- } = this;
- this.mergedConfig = util_2$1(util_1(defaultConfig, true), config);
- },
-
- calcSvgBorderGradient() {
- const {
- colors
- } = this.mergedConfig;
- const colorNum = colors.length;
- const colorOffsetGap = 100 / (colorNum - 1);
- this.svgBorderGradient = colors.map((c, i) => [colorOffsetGap * i, c]);
- },
-
- calcDetails() {
- const {
- data,
- formatter
- } = this.mergedConfig;
-
- if (!data.length) {
- this.details = '';
- return;
- }
-
- const maxValue = Math.max(...data);
- this.details = formatter.replace('{value}', maxValue);
- },
-
- addWave() {
- const {
- renderer,
- getWaveShapes,
- getWaveStyle,
- drawed
- } = this;
- const shapes = getWaveShapes();
- const style = getWaveStyle();
- this.waves = shapes.map(shape => renderer.add({
- name: 'smoothline',
- animationFrame: 300,
- shape,
- style,
- drawed
- }));
- },
-
- getWaveShapes() {
- const {
- mergedConfig,
- renderer,
- mergeOffset
- } = this;
- const {
- waveNum,
- waveHeight,
- data
- } = mergedConfig;
- const [w, h] = renderer.area;
- const pointsNum = waveNum * 4 + 4;
- const pointXGap = w / waveNum / 2;
- return data.map(v => {
- let points = new Array(pointsNum).fill(0).map((foo, j) => {
- const x = w - pointXGap * j;
- const startY = (1 - v / 100) * h;
- const y = j % 2 === 0 ? startY : startY - waveHeight;
- return [x, y];
- });
- points = points.map(p => mergeOffset(p, [pointXGap * 2, 0]));
- return {
- points
- };
- });
- },
-
- mergeOffset([x, y], [ox, oy]) {
- return [x + ox, y + oy];
- },
-
- getWaveStyle() {
- const {
- renderer,
- mergedConfig
- } = this;
- const h = renderer.area[1];
- return {
- gradientColor: mergedConfig.colors,
- gradientType: 'linear',
- gradientParams: [0, 0, 0, h],
- gradientWith: 'fill',
- opacity: mergedConfig.waveOpacity,
- translate: [0, 0]
- };
- },
-
- drawed({
- shape: {
- points
- }
- }, {
- ctx,
- area
- }) {
- const firstPoint = points[0];
- const lastPoint = points.slice(-1)[0];
- const h = area[1];
- ctx.lineTo(lastPoint[0], h);
- ctx.lineTo(firstPoint[0], h);
- ctx.closePath();
- ctx.fill();
- },
-
- async animationWave(repeat = 1) {
- const {
- waves,
- renderer,
- animation
- } = this;
- if (animation) return;
- this.animation = true;
- const w = renderer.area[0];
- waves.forEach(graph => {
- graph.attr('style', {
- translate: [0, 0]
- });
- graph.animation('style', {
- translate: [w, 0]
- }, true);
- });
- await renderer.launchAnimation();
- this.animation = false;
- if (!renderer.graphs.length) return;
- this.animationWave(repeat + 1);
- }
-
- },
-
- mounted() {
- const {
- init
- } = this;
- init();
- },
-
- beforeDestroy() {
- const {
- renderer
- } = this;
- renderer.delAllGraph();
- this.waves = [];
- }
-
- };
-
- /* script */
- const __vue_script__$v = script$v;
-
- /* template */
- var __vue_render__$v = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { staticClass: "dv-water-pond-level" }, [
- _vm.renderer
- ? _c("svg", [
- _c(
- "defs",
- [
- _c(
- "linearGradient",
- {
- attrs: {
- id: _vm.gradientId,
- x1: "0%",
- y1: "0%",
- x2: "0%",
- y2: "100%"
- }
- },
- _vm._l(_vm.svgBorderGradient, function(lc) {
- return _c("stop", {
- key: lc[0],
- attrs: { offset: lc[0], "stop-color": lc[1] }
- })
- }),
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _vm.renderer
- ? _c(
- "text",
- {
- attrs: {
- stroke: "url(#" + _vm.gradientId + ")",
- fill: "url(#" + _vm.gradientId + ")",
- x: _vm.renderer.area[0] / 2 + 8,
- y: _vm.renderer.area[1] / 2 + 8
- }
- },
- [_vm._v("\n " + _vm._s(_vm.details) + "\n ")]
- )
- : _vm._e(),
- _vm._v(" "),
- !_vm.shape || _vm.shape === "round"
- ? _c("ellipse", {
- attrs: {
- cx: _vm.renderer.area[0] / 2 + 8,
- cy: _vm.renderer.area[1] / 2 + 8,
- rx: _vm.renderer.area[0] / 2 + 5,
- ry: _vm.renderer.area[1] / 2 + 5,
- stroke: "url(#" + _vm.gradientId + ")"
- }
- })
- : _c("rect", {
- attrs: {
- x: "2",
- y: "2",
- rx: _vm.shape === "roundRect" ? 10 : 0,
- ry: _vm.shape === "roundRect" ? 10 : 0,
- width: _vm.renderer.area[0] + 12,
- height: _vm.renderer.area[1] + 12,
- stroke: "url(#" + _vm.gradientId + ")"
- }
- })
- ])
- : _vm._e(),
- _vm._v(" "),
- _c("canvas", {
- ref: "water-pond-level",
- style: "border-radius: " + _vm.radius + ";"
- })
- ])
- };
- var __vue_staticRenderFns__$v = [];
- __vue_render__$v._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$v = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$v = undefined;
- /* module identifier */
- const __vue_module_identifier__$v = undefined;
- /* functional template */
- const __vue_is_functional_template__$v = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$v = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$v, staticRenderFns: __vue_staticRenderFns__$v },
- __vue_inject_styles__$v,
- __vue_script__$v,
- __vue_scope_id__$v,
- __vue_is_functional_template__$v,
- __vue_module_identifier__$v,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function waterLevelPond (Vue) {
- Vue.component(__vue_component__$v.name, __vue_component__$v);
- }
-
- //
- var script$w = {
- name: 'DvPercentPond',
- props: {
- config: {
- type: Object,
- default: () => ({})
- }
- },
-
- data() {
- const id = uuid();
- return {
- gradientId1: `percent-pond-gradientId1-${id}`,
- gradientId2: `percent-pond-gradientId2-${id}`,
- width: 0,
- height: 0,
- defaultConfig: {
- /**
- * @description Value
- * @type {Number}
- * @default value = 0
- */
- value: 0,
-
- /**
- * @description Colors (hex|rgb|rgba|color keywords)
- * @type {Array<String>}
- * @default colors = ['#00BAFF', '#3DE7C9']
- * @example colors = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red']
- */
- colors: ['#3DE7C9', '#00BAFF'],
-
- /**
- * @description Border width
- * @type {Number}
- * @default borderWidth = 3
- */
- borderWidth: 3,
-
- /**
- * @description Gap between border and pond
- * @type {Number}
- * @default borderGap = 3
- */
- borderGap: 3,
-
- /**
- * @description Line dash
- * @type {Array<Number>}
- * @default lineDash = [5, 1]
- */
- lineDash: [5, 1],
-
- /**
- * @description Text color
- * @type {String}
- * @default textColor = '#fff'
- */
- textColor: '#fff',
-
- /**
- * @description Border radius
- * @type {Number}
- * @default borderRadius = 5
- */
- borderRadius: 5,
-
- /**
- * @description Local Gradient
- * @type {Boolean}
- * @default localGradient = false
- * @example localGradient = false | true
- */
- localGradient: false,
-
- /**
- * @description Formatter
- * @type {String}
- * @default formatter = '{value}%'
- */
- formatter: '{value}%'
- },
- mergedConfig: null
- };
- },
-
- computed: {
- rectWidth() {
- const {
- mergedConfig,
- width
- } = this;
- if (!mergedConfig) return 0;
- const {
- borderWidth
- } = mergedConfig;
- return width - borderWidth;
- },
-
- rectHeight() {
- const {
- mergedConfig,
- height
- } = this;
- if (!mergedConfig) return 0;
- const {
- borderWidth
- } = mergedConfig;
- return height - borderWidth;
- },
-
- points() {
- const {
- mergedConfig,
- width,
- height
- } = this;
- const halfHeight = height / 2;
- if (!mergedConfig) return `0, ${halfHeight} 0, ${halfHeight}`;
- const {
- borderWidth,
- borderGap,
- value
- } = mergedConfig;
- const polylineLength = (width - (borderWidth + borderGap) * 2) / 100 * value;
- return `
- ${borderWidth + borderGap}, ${halfHeight}
- ${borderWidth + borderGap + polylineLength}, ${halfHeight + 0.001}
- `;
- },
-
- polylineWidth() {
- const {
- mergedConfig,
- height
- } = this;
- if (!mergedConfig) return 0;
- const {
- borderWidth,
- borderGap
- } = mergedConfig;
- return height - (borderWidth + borderGap) * 2;
- },
-
- linearGradient() {
- const {
- mergedConfig
- } = this;
- if (!mergedConfig) return [];
- const {
- colors
- } = mergedConfig;
- const colorNum = colors.length;
- const colorOffsetGap = 100 / (colorNum - 1);
- return colors.map((c, i) => [colorOffsetGap * i, c]);
- },
-
- polylineGradient() {
- const {
- gradientId1,
- gradientId2,
- mergedConfig
- } = this;
- if (!mergedConfig) return gradientId2;
- if (mergedConfig.localGradient) return gradientId1;
- return gradientId2;
- },
-
- gradient2XPos() {
- const {
- mergedConfig
- } = this;
- if (!mergedConfig) return '100%';
- const {
- value
- } = mergedConfig;
- return `${200 - value}%`;
- },
-
- details() {
- const {
- mergedConfig
- } = this;
- if (!mergedConfig) return '';
- const {
- value,
- formatter
- } = mergedConfig;
- return formatter.replace('{value}', value);
- }
-
- },
- watch: {
- config() {
- const {
- mergeConfig
- } = this;
- mergeConfig();
- }
-
- },
- methods: {
- async init() {
- const {
- initWH,
- config,
- mergeConfig
- } = this;
- await initWH();
- if (!config) return;
- mergeConfig();
- },
-
- async initWH() {
- const {
- $nextTick,
- $refs
- } = this;
- await $nextTick();
- const {
- clientWidth,
- clientHeight
- } = $refs['percent-pond'];
- this.width = clientWidth;
- this.height = clientHeight;
- },
-
- mergeConfig() {
- const {
- config,
- defaultConfig
- } = this;
- this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
- }
-
- },
-
- mounted() {
- const {
- init
- } = this;
- init();
- }
-
- };
-
- /* script */
- const __vue_script__$w = script$w;
-
- /* template */
- var __vue_render__$w = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: "percent-pond", staticClass: "dv-percent-pond" }, [
- _c("svg", [
- _c(
- "defs",
- [
- _c(
- "linearGradient",
- {
- attrs: {
- id: _vm.gradientId1,
- x1: "0%",
- y1: "0%",
- x2: "100%",
- y2: "0%"
- }
- },
- _vm._l(_vm.linearGradient, function(lc) {
- return _c("stop", {
- key: lc[0],
- attrs: { offset: lc[0] + "%", "stop-color": lc[1] }
- })
- }),
- 1
- ),
- _vm._v(" "),
- _c(
- "linearGradient",
- {
- attrs: {
- id: _vm.gradientId2,
- x1: "0%",
- y1: "0%",
- x2: _vm.gradient2XPos,
- y2: "0%"
- }
- },
- _vm._l(_vm.linearGradient, function(lc) {
- return _c("stop", {
- key: lc[0],
- attrs: { offset: lc[0] + "%", "stop-color": lc[1] }
- })
- }),
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c("rect", {
- attrs: {
- x: _vm.mergedConfig ? _vm.mergedConfig.borderWidth / 2 : "0",
- y: _vm.mergedConfig ? _vm.mergedConfig.borderWidth / 2 : "0",
- rx: _vm.mergedConfig ? _vm.mergedConfig.borderRadius : "0",
- ry: _vm.mergedConfig ? _vm.mergedConfig.borderRadius : "0",
- fill: "transparent",
- "stroke-width": _vm.mergedConfig ? _vm.mergedConfig.borderWidth : "0",
- stroke: "url(#" + _vm.gradientId1 + ")",
- width: _vm.rectWidth > 0 ? _vm.rectWidth : 0,
- height: _vm.rectHeight > 0 ? _vm.rectHeight : 0
- }
- }),
- _vm._v(" "),
- _c("polyline", {
- attrs: {
- "stroke-width": _vm.polylineWidth,
- "stroke-dasharray": _vm.mergedConfig
- ? _vm.mergedConfig.lineDash.join(",")
- : "0",
- stroke: "url(#" + _vm.polylineGradient + ")",
- points: _vm.points
- }
- }),
- _vm._v(" "),
- _c(
- "text",
- {
- attrs: {
- stroke: _vm.mergedConfig ? _vm.mergedConfig.textColor : "#fff",
- fill: _vm.mergedConfig ? _vm.mergedConfig.textColor : "#fff",
- x: _vm.width / 2,
- y: _vm.height / 2
- }
- },
- [_vm._v("\n " + _vm._s(_vm.details) + "\n ")]
- )
- ])
- ])
- };
- var __vue_staticRenderFns__$w = [];
- __vue_render__$w._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$w = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$w = undefined;
- /* module identifier */
- const __vue_module_identifier__$w = undefined;
- /* functional template */
- const __vue_is_functional_template__$w = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$w = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$w, staticRenderFns: __vue_staticRenderFns__$w },
- __vue_inject_styles__$w,
- __vue_script__$w,
- __vue_scope_id__$w,
- __vue_is_functional_template__$w,
- __vue_module_identifier__$w,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function percentPond (Vue) {
- Vue.component(__vue_component__$w.name, __vue_component__$w);
- }
-
- //
- var script$x = {
- name: 'DvFlylineChart',
- mixins: [autoResize],
- props: {
- config: {
- type: Object,
- default: () => ({})
- },
- dev: {
- type: Boolean,
- default: false
- }
- },
-
- data() {
- const id = uuid();
- return {
- ref: 'dv-flyline-chart',
- unique: Math.random(),
- maskId: `flyline-mask-id-${id}`,
- maskCircleId: `mask-circle-id-${id}`,
- gradientId: `gradient-id-${id}`,
- gradient2Id: `gradient2-id-${id}`,
- defaultConfig: {
- /**
- * @description Flyline chart center point
- * @type {Array<Number>}
- * @default centerPoint = [0, 0]
- */
- centerPoint: [0, 0],
-
- /**
- * @description Flyline start points
- * @type {Array<Array<Number>>}
- * @default points = []
- * @example points = [[10, 10], [100, 100]]
- */
- points: [],
-
- /**
- * @description Flyline width
- * @type {Number}
- * @default lineWidth = 1
- */
- lineWidth: 1,
-
- /**
- * @description Orbit color
- * @type {String}
- * @default orbitColor = 'rgba(103, 224, 227, .2)'
- */
- orbitColor: 'rgba(103, 224, 227, .2)',
-
- /**
- * @description Flyline color
- * @type {String}
- * @default orbitColor = '#ffde93'
- */
- flylineColor: '#ffde93',
-
- /**
- * @description K value
- * @type {Number}
- * @default k = -0.5
- * @example k = -1 ~ 1
- */
- k: -0.5,
-
- /**
- * @description Flyline curvature
- * @type {Number}
- * @default curvature = 5
- */
- curvature: 5,
-
- /**
- * @description Flyline radius
- * @type {Number}
- * @default flylineRadius = 100
- */
- flylineRadius: 100,
-
- /**
- * @description Flyline animation duration
- * @type {Array<Number>}
- * @default duration = [20, 30]
- */
- duration: [20, 30],
-
- /**
- * @description Relative points position
- * @type {Boolean}
- * @default relative = true
- */
- relative: true,
-
- /**
- * @description Back ground image url
- * @type {String}
- * @default bgImgUrl = ''
- * @example bgImgUrl = './img/bg.jpg'
- */
- bgImgUrl: '',
-
- /**
- * @description Text configuration
- * @type {Object}
- */
- text: {
- /**
- * @description Text offset
- * @type {Array<Number>}
- * @default offset = [0, 15]
- */
- offset: [0, 15],
-
- /**
- * @description Text color
- * @type {String}
- * @default color = '#ffdb5c'
- */
- color: '#ffdb5c',
-
- /**
- * @description Text font size
- * @type {Number}
- * @default fontSize = 12
- */
- fontSize: 12
- },
-
- /**
- * @description Halo configuration
- * @type {Object}
- */
- halo: {
- /**
- * @description Weather to show halo
- * @type {Boolean}
- * @default show = true
- * @example show = true | false
- */
- show: true,
-
- /**
- * @description Halo animation duration (10 = 1s)
- * @type {Number}
- * @default duration = 30
- */
- duration: 30,
-
- /**
- * @description Halo color
- * @type {String}
- * @default color = '#fb7293'
- */
- color: '#fb7293',
-
- /**
- * @description Halo max radius
- * @type {Number}
- * @default radius = 120
- */
- radius: 120
- },
-
- /**
- * @description Center point img configuration
- * @type {Object}
- */
- centerPointImg: {
- /**
- * @description Center point img width
- * @type {Number}
- * @default width = 40
- */
- width: 40,
-
- /**
- * @description Center point img height
- * @type {Number}
- * @default height = 40
- */
- height: 40,
-
- /**
- * @description Center point img url
- * @type {String}
- * @default url = ''
- */
- url: ''
- },
-
- /**
- * @description Points img configuration
- * @type {Object}
- * @default radius = 120
- */
- pointsImg: {
- /**
- * @description Points img width
- * @type {Number}
- * @default width = 15
- */
- width: 15,
-
- /**
- * @description Points img height
- * @type {Number}
- * @default height = 15
- */
- height: 15,
-
- /**
- * @description Points img url
- * @type {String}
- * @default url = ''
- */
- url: ''
- }
- },
- mergedConfig: null,
- paths: [],
- lengths: [],
- times: [],
- texts: []
- };
- },
-
- watch: {
- config() {
- const {
- calcData
- } = this;
- calcData();
- }
-
- },
- methods: {
- afterAutoResizeMixinInit() {
- const {
- calcData
- } = this;
- calcData();
- },
-
- onResize() {
- const {
- calcData
- } = this;
- calcData();
- },
-
- async calcData() {
- const {
- mergeConfig,
- createFlylinePaths,
- calcLineLengths
- } = this;
- mergeConfig();
- createFlylinePaths();
- await calcLineLengths();
- const {
- calcTimes,
- calcTexts
- } = this;
- calcTimes();
- calcTexts();
- },
-
- mergeConfig() {
- let {
- config,
- defaultConfig
- } = this;
- const mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
- const {
- points
- } = mergedConfig;
- mergedConfig.points = points.map(item => {
- if (item instanceof Array) {
- return {
- position: item,
- text: ''
- };
- }
-
- return item;
- });
- this.mergedConfig = mergedConfig;
- },
-
- createFlylinePaths() {
- const {
- getPath,
- mergedConfig,
- width,
- height
- } = this;
- let {
- centerPoint,
- points,
- relative
- } = mergedConfig;
- points = points.map(({
- position
- }) => position);
-
- if (relative) {
- centerPoint = [width * centerPoint[0], height * centerPoint[1]];
- points = points.map(([x, y]) => [width * x, height * y]);
- }
-
- this.paths = points.map(point => getPath(centerPoint, point));
- },
-
- getPath(center, point) {
- const {
- getControlPoint
- } = this;
- const controlPoint = getControlPoint(center, point);
- return [point, controlPoint, center];
- },
-
- getControlPoint([sx, sy], [ex, ey]) {
- const {
- getKLinePointByx,
- mergedConfig
- } = this;
- const {
- curvature,
- k
- } = mergedConfig;
- const [mx, my] = [(sx + ex) / 2, (sy + ey) / 2];
- const distance = getPointDistance([sx, sy], [ex, ey]);
- const targetLength = distance / curvature;
- const disDived = targetLength / 2;
- let [dx, dy] = [mx, my];
-
- do {
- dx += disDived;
- dy = getKLinePointByx(k, [mx, my], dx)[1];
- } while (getPointDistance([mx, my], [dx, dy]) < targetLength);
-
- return [dx, dy];
- },
-
- getKLinePointByx(k, [lx, ly], x) {
- const y = ly - k * lx + k * x;
- return [x, y];
- },
-
- async calcLineLengths() {
- const {
- $nextTick,
- paths,
- $refs
- } = this;
- await $nextTick();
- this.lengths = paths.map((foo, i) => $refs[`path${i}`][0].getTotalLength());
- },
-
- calcTimes() {
- const {
- duration,
- points
- } = this.mergedConfig;
- this.times = points.map(foo => randomExtend(...duration) / 10);
- },
-
- calcTexts() {
- const {
- points
- } = this.mergedConfig;
- this.texts = points.map(({
- text
- }) => text);
- },
-
- consoleClickPos({
- offsetX,
- offsetY
- }) {
- const {
- width,
- height,
- dev
- } = this;
- if (!dev) return;
- const relativeX = (offsetX / width).toFixed(2);
- const relativeY = (offsetY / height).toFixed(2);
- console.warn(`dv-flyline-chart DEV: \n Click Position is [${offsetX}, ${offsetY}] \n Relative Position is [${relativeX}, ${relativeY}]`);
- }
-
- }
- };
-
- /* script */
- const __vue_script__$x = script$x;
-
- /* template */
- var __vue_render__$x = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c(
- "div",
- {
- ref: "dv-flyline-chart",
- staticClass: "dv-flyline-chart",
- style:
- "background-image: url(" +
- (_vm.mergedConfig ? _vm.mergedConfig.bgImgUrl : "") +
- ")",
- on: { click: _vm.consoleClickPos }
- },
- [
- _vm.mergedConfig
- ? _c(
- "svg",
- { attrs: { width: _vm.width, height: _vm.height } },
- [
- _c(
- "defs",
- [
- _c(
- "radialGradient",
- {
- attrs: {
- id: _vm.gradientId,
- cx: "50%",
- cy: "50%",
- r: "50%"
- }
- },
- [
- _c("stop", {
- attrs: {
- offset: "0%",
- "stop-color": "#fff",
- "stop-opacity": "1"
- }
- }),
- _vm._v(" "),
- _c("stop", {
- attrs: {
- offset: "100%",
- "stop-color": "#fff",
- "stop-opacity": "0"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "radialGradient",
- {
- attrs: {
- id: _vm.gradient2Id,
- cx: "50%",
- cy: "50%",
- r: "50%"
- }
- },
- [
- _c("stop", {
- attrs: {
- offset: "0%",
- "stop-color": "#fff",
- "stop-opacity": "0"
- }
- }),
- _vm._v(" "),
- _c("stop", {
- attrs: {
- offset: "100%",
- "stop-color": "#fff",
- "stop-opacity": "1"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _vm.paths[0]
- ? _c(
- "circle",
- {
- attrs: {
- id: "circle" + _vm.paths[0].toString(),
- cx: _vm.paths[0][2][0],
- cy: _vm.paths[0][2][1]
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "r",
- values: "1;" + _vm.mergedConfig.halo.radius,
- dur: _vm.mergedConfig.halo.duration / 10 + "s",
- repeatCount: "indefinite"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "opacity",
- values: "1;0",
- dur: _vm.mergedConfig.halo.duration / 10 + "s",
- repeatCount: "indefinite"
- }
- })
- ]
- )
- : _vm._e()
- ],
- 1
- ),
- _vm._v(" "),
- _vm.paths[0]
- ? _c("image", {
- attrs: {
- "xlink:href": _vm.mergedConfig.centerPointImg.url,
- width: _vm.mergedConfig.centerPointImg.width,
- height: _vm.mergedConfig.centerPointImg.height,
- x:
- _vm.paths[0][2][0] -
- _vm.mergedConfig.centerPointImg.width / 2,
- y:
- _vm.paths[0][2][1] -
- _vm.mergedConfig.centerPointImg.height / 2
- }
- })
- : _vm._e(),
- _vm._v(" "),
- _c(
- "mask",
- { attrs: { id: "maskhalo" + _vm.paths[0].toString() } },
- [
- _vm.paths[0]
- ? _c("use", {
- attrs: {
- "xlink:href": "#circle" + _vm.paths[0].toString(),
- fill: "url(#" + _vm.gradient2Id + ")"
- }
- })
- : _vm._e()
- ]
- ),
- _vm._v(" "),
- _vm.paths[0] && _vm.mergedConfig.halo.show
- ? _c("use", {
- attrs: {
- "xlink:href": "#circle" + _vm.paths[0].toString(),
- fill: _vm.mergedConfig.halo.color,
- mask: "url(#maskhalo" + _vm.paths[0].toString() + ")"
- }
- })
- : _vm._e(),
- _vm._v(" "),
- _vm._l(_vm.paths, function(path, i) {
- return _c("g", { key: i }, [
- _c("defs", [
- _c("path", {
- ref: "path" + i,
- refInFor: true,
- attrs: {
- id: "path" + path.toString(),
- d:
- "M" +
- path[0].toString() +
- " Q" +
- path[1].toString() +
- " " +
- path[2].toString(),
- fill: "transparent"
- }
- })
- ]),
- _vm._v(" "),
- _c("use", {
- attrs: {
- "xlink:href": "#path" + path.toString(),
- "stroke-width": _vm.mergedConfig.lineWidth,
- stroke: _vm.mergedConfig.orbitColor
- }
- }),
- _vm._v(" "),
- _vm.lengths[i]
- ? _c(
- "use",
- {
- attrs: {
- "xlink:href": "#path" + path.toString(),
- "stroke-width": _vm.mergedConfig.lineWidth,
- stroke: _vm.mergedConfig.flylineColor,
- mask:
- "url(#mask" + _vm.unique + path.toString() + ")"
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "stroke-dasharray",
- from: "0, " + _vm.lengths[i],
- to: _vm.lengths[i] + ", 0",
- dur: _vm.times[i] || 0,
- repeatCount: "indefinite"
- }
- })
- ]
- )
- : _vm._e(),
- _vm._v(" "),
- _c(
- "mask",
- { attrs: { id: "mask" + _vm.unique + path.toString() } },
- [
- _c(
- "circle",
- {
- attrs: {
- cx: "0",
- cy: "0",
- r: _vm.mergedConfig.flylineRadius,
- fill: "url(#" + _vm.gradientId + ")"
- }
- },
- [
- _c("animateMotion", {
- attrs: {
- dur: _vm.times[i] || 0,
- path:
- "M" +
- path[0].toString() +
- " Q" +
- path[1].toString() +
- " " +
- path[2].toString(),
- rotate: "auto",
- repeatCount: "indefinite"
- }
- })
- ],
- 1
- )
- ]
- ),
- _vm._v(" "),
- _c("image", {
- attrs: {
- "xlink:href": _vm.mergedConfig.pointsImg.url,
- width: _vm.mergedConfig.pointsImg.width,
- height: _vm.mergedConfig.pointsImg.height,
- x: path[0][0] - _vm.mergedConfig.pointsImg.width / 2,
- y: path[0][1] - _vm.mergedConfig.pointsImg.height / 2
- }
- }),
- _vm._v(" "),
- _c(
- "text",
- {
- style:
- "fontSize:" + _vm.mergedConfig.text.fontSize + "px;",
- attrs: {
- fill: _vm.mergedConfig.text.color,
- x: path[0][0] + _vm.mergedConfig.text.offset[0],
- y: path[0][1] + _vm.mergedConfig.text.offset[1]
- }
- },
- [_vm._v("\n " + _vm._s(_vm.texts[i]) + "\n ")]
- )
- ])
- })
- ],
- 2
- )
- : _vm._e()
- ]
- )
- };
- var __vue_staticRenderFns__$x = [];
- __vue_render__$x._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$x = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$x = undefined;
- /* module identifier */
- const __vue_module_identifier__$x = undefined;
- /* functional template */
- const __vue_is_functional_template__$x = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$x = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$x, staticRenderFns: __vue_staticRenderFns__$x },
- __vue_inject_styles__$x,
- __vue_script__$x,
- __vue_scope_id__$x,
- __vue_is_functional_template__$x,
- __vue_module_identifier__$x,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function flylineChart (Vue) {
- Vue.component(__vue_component__$x.name, __vue_component__$x);
- }
-
- //
- var script$y = {
- name: 'DvFlylineChartEnhanced',
- mixins: [autoResize],
- props: {
- config: {
- type: Object,
- default: () => ({})
- },
- dev: {
- type: Boolean,
- default: false
- }
- },
-
- data() {
- const id = uuid();
- return {
- ref: 'dv-flyline-chart-enhanced',
- unique: Math.random(),
- flylineGradientId: `flyline-gradient-id-${id}`,
- haloGradientId: `halo-gradient-id-${id}`,
-
- /**
- * @description Type Declaration
- *
- * interface Halo {
- * show?: boolean
- * duration?: [number, number]
- * color?: string
- * radius?: number
- * }
- *
- * interface Text {
- * show?: boolean
- * offset?: [number, number]
- * color?: string
- * fontSize?: number
- * }
- *
- * interface Icon {
- * show?: boolean
- * src?: string
- * width?: number
- * height?: number
- * }
- *
- * interface Point {
- * name: string
- * coordinate: [number, number]
- * halo?: Halo
- * text?: Text
- * icon?: Icon
- * }
- *
- * interface Line {
- * width?: number
- * color?: string
- * orbitColor?: string
- * duration?: [number, number]
- * radius?: string
- * }
- *
- * interface Flyline extends Line {
- * source: string
- * target: string
- * }
- *
- * interface FlylineWithPath extends Flyline {
- * d: string
- * path: [[number, number], [number, number], [number, number]]
- * key: string
- * }
- */
- defaultConfig: {
- /**
- * @description Flyline chart points
- * @type {Point[]}
- * @default points = []
- */
- points: [],
-
- /**
- * @description Lines
- * @type {Flyline[]}
- * @default lines = []
- */
- lines: [],
-
- /**
- * @description Global halo configuration
- * @type {Halo}
- */
- halo: {
- /**
- * @description Whether to show halo
- * @type {Boolean}
- * @default show = false
- */
- show: false,
-
- /**
- * @description Halo animation duration (1s = 10)
- * @type {[number, number]}
- */
- duration: [20, 30],
-
- /**
- * @description Halo color
- * @type {String}
- * @default color = '#fb7293'
- */
- color: '#fb7293',
-
- /**
- * @description Halo radius
- * @type {Number}
- * @default radius = 120
- */
- radius: 120
- },
-
- /**
- * @description Global text configuration
- * @type {Text}
- */
- text: {
- /**
- * @description Whether to show text
- * @type {Boolean}
- * @default show = false
- */
- show: false,
-
- /**
- * @description Text offset
- * @type {[number, number]}
- * @default offset = [0, 15]
- */
- offset: [0, 15],
-
- /**
- * @description Text color
- * @type {String}
- * @default color = '#ffdb5c'
- */
- color: '#ffdb5c',
-
- /**
- * @description Text font size
- * @type {Number}
- * @default fontSize = 12
- */
- fontSize: 12
- },
-
- /**
- * @description Global icon configuration
- * @type {Icon}
- */
- icon: {
- /**
- * @description Whether to show icon
- * @type {Boolean}
- * @default show = false
- */
- show: false,
-
- /**
- * @description Icon src
- * @type {String}
- * @default src = ''
- */
- src: '',
-
- /**
- * @description Icon width
- * @type {Number}
- * @default width = 15
- */
- width: 15,
-
- /**
- * @description Icon height
- * @type {Number}
- * @default width = 15
- */
- height: 15
- },
-
- /**
- * @description Global line configuration
- * @type {Line}
- */
- line: {
- /**
- * @description Line width
- * @type {Number}
- * @default width = 1
- */
- width: 1,
-
- /**
- * @description Flyline color
- * @type {String}
- * @default color = '#ffde93'
- */
- color: '#ffde93',
-
- /**
- * @description Orbit color
- * @type {String}
- * @default orbitColor = 'rgba(103, 224, 227, .2)'
- */
- orbitColor: 'rgba(103, 224, 227, .2)',
-
- /**
- * @description Flyline animation duration
- * @type {[number, number]}
- * @default duration = [20, 30]
- */
- duration: [20, 30],
-
- /**
- * @description Flyline radius
- * @type {Number}
- * @default radius = 100
- */
- radius: 100
- },
-
- /**
- * @description Back ground image url
- * @type {String}
- * @default bgImgSrc = ''
- */
- bgImgSrc: '',
-
- /**
- * @description K value
- * @type {Number}
- * @default k = -0.5
- * @example k = -1 ~ 1
- */
- k: -0.5,
-
- /**
- * @description Flyline curvature
- * @type {Number}
- * @default curvature = 5
- */
- curvature: 5,
-
- /**
- * @description Relative points position
- * @type {Boolean}
- * @default relative = true
- */
- relative: true
- },
-
- /**
- * @description Fly line data
- * @type {FlylineWithPath[]}
- * @default flylines = []
- */
- flylines: [],
-
- /**
- * @description Fly line lengths
- * @type {Number[]}
- * @default flylineLengths = []
- */
- flylineLengths: [],
-
- /**
- * @description Fly line points
- * @default flylinePoints = []
- */
- flylinePoints: [],
- mergedConfig: null
- };
- },
-
- watch: {
- config() {
- const {
- calcData
- } = this;
- calcData();
- }
-
- },
- methods: {
- afterAutoResizeMixinInit() {
- const {
- calcData
- } = this;
- calcData();
- },
-
- onResize() {
- const {
- calcData
- } = this;
- calcData();
- },
-
- async calcData() {
- const {
- mergeConfig,
- calcflylinePoints,
- calcLinePaths
- } = this;
- mergeConfig();
- calcflylinePoints();
- calcLinePaths();
- const {
- calcLineLengths
- } = this;
- await calcLineLengths();
- },
-
- mergeConfig() {
- let {
- config,
- defaultConfig
- } = this;
- const mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
- const {
- points,
- lines,
- halo,
- text,
- icon,
- line
- } = mergedConfig;
- mergedConfig.points = points.map(item => {
- item.halo = util_2$1(util_1(halo, true), item.halo || {});
- item.text = util_2$1(util_1(text, true), item.text || {});
- item.icon = util_2$1(util_1(icon, true), item.icon || {});
- return item;
- });
- mergedConfig.lines = lines.map(item => {
- return util_2$1(util_1(line, true), item);
- });
- this.mergedConfig = mergedConfig;
- },
-
- calcflylinePoints() {
- const {
- mergedConfig,
- width,
- height
- } = this;
- const {
- relative,
- points
- } = mergedConfig;
- this.flylinePoints = points.map((item, i) => {
- const {
- coordinate: [x, y],
- halo,
- icon,
- text
- } = item;
- if (relative) item.coordinate = [x * width, y * height];
- item.halo.time = randomExtend(...halo.duration) / 10;
- const {
- width: iw,
- height: ih
- } = icon;
- item.icon.x = item.coordinate[0] - iw / 2;
- item.icon.y = item.coordinate[1] - ih / 2;
- const [ox, oy] = text.offset;
- item.text.x = item.coordinate[0] + ox;
- item.text.y = item.coordinate[1] + oy;
- item.key = `${item.coordinate.toString()}${i}`;
- return item;
- });
- },
-
- calcLinePaths() {
- const {
- getPath,
- mergedConfig
- } = this;
- const {
- points,
- lines
- } = mergedConfig;
- this.flylines = lines.map(item => {
- const {
- source,
- target,
- duration
- } = item;
- const sourcePoint = points.find(({
- name
- }) => name === source).coordinate;
- const targetPoint = points.find(({
- name
- }) => name === target).coordinate;
- const path = getPath(sourcePoint, targetPoint).map(item => item.map(v => parseFloat(v.toFixed(10))));
- const d = `M${path[0].toString()} Q${path[1].toString()} ${path[2].toString()}`;
- const key = `path${path.toString()}`;
- const time = randomExtend(...duration) / 10;
- return { ...item,
- path,
- key,
- d,
- time
- };
- });
- },
-
- getPath(start, end) {
- const {
- getControlPoint
- } = this;
- const controlPoint = getControlPoint(start, end);
- return [start, controlPoint, end];
- },
-
- getControlPoint([sx, sy], [ex, ey]) {
- const {
- getKLinePointByx,
- mergedConfig
- } = this;
- const {
- curvature,
- k
- } = mergedConfig;
- const [mx, my] = [(sx + ex) / 2, (sy + ey) / 2];
- const distance = getPointDistance([sx, sy], [ex, ey]);
- const targetLength = distance / curvature;
- const disDived = targetLength / 2;
- let [dx, dy] = [mx, my];
-
- do {
- dx += disDived;
- dy = getKLinePointByx(k, [mx, my], dx)[1];
- } while (getPointDistance([mx, my], [dx, dy]) < targetLength);
-
- return [dx, dy];
- },
-
- getKLinePointByx(k, [lx, ly], x) {
- const y = ly - k * lx + k * x;
- return [x, y];
- },
-
- async calcLineLengths() {
- const {
- $nextTick,
- flylines,
- $refs
- } = this;
- await $nextTick();
- this.flylineLengths = flylines.map(({
- key
- }) => $refs[key][0].getTotalLength());
- },
-
- consoleClickPos({
- offsetX,
- offsetY
- }) {
- const {
- width,
- height,
- dev
- } = this;
- if (!dev) return;
- const relativeX = (offsetX / width).toFixed(2);
- const relativeY = (offsetY / height).toFixed(2);
- console.warn(`dv-flyline-chart-enhanced DEV: \n Click Position is [${offsetX}, ${offsetY}] \n Relative Position is [${relativeX}, ${relativeY}]`);
- }
-
- }
- };
-
- /* script */
- const __vue_script__$y = script$y;
-
- /* template */
- var __vue_render__$y = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c(
- "div",
- {
- ref: _vm.ref,
- staticClass: "dv-flyline-chart-enhanced",
- style:
- "background-image: url(" +
- (_vm.mergedConfig ? _vm.mergedConfig.bgImgSrc : "") +
- ")",
- on: { click: _vm.consoleClickPos }
- },
- [
- _vm.flylines.length
- ? _c(
- "svg",
- { attrs: { width: _vm.width, height: _vm.height } },
- [
- _c(
- "defs",
- [
- _c(
- "radialGradient",
- {
- attrs: {
- id: _vm.flylineGradientId,
- cx: "50%",
- cy: "50%",
- r: "50%"
- }
- },
- [
- _c("stop", {
- attrs: {
- offset: "0%",
- "stop-color": "#fff",
- "stop-opacity": "1"
- }
- }),
- _vm._v(" "),
- _c("stop", {
- attrs: {
- offset: "100%",
- "stop-color": "#fff",
- "stop-opacity": "0"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "radialGradient",
- {
- attrs: {
- id: _vm.haloGradientId,
- cx: "50%",
- cy: "50%",
- r: "50%"
- }
- },
- [
- _c("stop", {
- attrs: {
- offset: "0%",
- "stop-color": "#fff",
- "stop-opacity": "0"
- }
- }),
- _vm._v(" "),
- _c("stop", {
- attrs: {
- offset: "100%",
- "stop-color": "#fff",
- "stop-opacity": "1"
- }
- })
- ],
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _vm._l(_vm.flylinePoints, function(point) {
- return _c("g", { key: point.key + Math.random() }, [
- _c("defs", [
- point.halo.show
- ? _c(
- "circle",
- {
- attrs: {
- id: "halo" + _vm.unique + point.key,
- cx: point.coordinate[0],
- cy: point.coordinate[1]
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "r",
- values: "1;" + point.halo.radius,
- dur: point.halo.time + "s",
- repeatCount: "indefinite"
- }
- }),
- _vm._v(" "),
- _c("animate", {
- attrs: {
- attributeName: "opacity",
- values: "1;0",
- dur: point.halo.time + "s",
- repeatCount: "indefinite"
- }
- })
- ]
- )
- : _vm._e()
- ]),
- _vm._v(" "),
- _c(
- "mask",
- { attrs: { id: "mask" + _vm.unique + point.key } },
- [
- point.halo.show
- ? _c("use", {
- attrs: {
- "xlink:href": "#halo" + _vm.unique + point.key,
- fill: "url(#" + _vm.haloGradientId + ")"
- }
- })
- : _vm._e()
- ]
- ),
- _vm._v(" "),
- point.halo.show
- ? _c("use", {
- attrs: {
- "xlink:href": "#halo" + _vm.unique + point.key,
- fill: point.halo.color,
- mask: "url(#mask" + _vm.unique + point.key + ")"
- }
- })
- : _vm._e(),
- _vm._v(" "),
- point.icon.show
- ? _c("image", {
- attrs: {
- "xlink:href": point.icon.src,
- width: point.icon.width,
- height: point.icon.height,
- x: point.icon.x,
- y: point.icon.y
- }
- })
- : _vm._e(),
- _vm._v(" "),
- point.text.show
- ? _c(
- "text",
- {
- style:
- "fontSize:" +
- point.text.fontSize +
- "px;color:" +
- point.text.color,
- attrs: {
- fill: point.text.color,
- x: point.text.x,
- y: point.text.y
- }
- },
- [_vm._v("\n " + _vm._s(point.name) + "\n ")]
- )
- : _vm._e()
- ])
- }),
- _vm._v(" "),
- _vm._l(_vm.flylines, function(line, i) {
- return _c("g", { key: line.key + Math.random() }, [
- _c("defs", [
- _c("path", {
- ref: line.key,
- refInFor: true,
- attrs: { id: line.key, d: line.d, fill: "transparent" }
- })
- ]),
- _vm._v(" "),
- _c("use", {
- attrs: {
- "xlink:href": "#" + line.key,
- "stroke-width": line.width,
- stroke: line.orbitColor
- }
- }),
- _vm._v(" "),
- _c(
- "mask",
- { attrs: { id: "mask" + _vm.unique + line.key } },
- [
- _c(
- "circle",
- {
- attrs: {
- cx: "0",
- cy: "0",
- r: line.radius,
- fill: "url(#" + _vm.flylineGradientId + ")"
- }
- },
- [
- _c("animateMotion", {
- attrs: {
- dur: line.time,
- path: line.d,
- rotate: "auto",
- repeatCount: "indefinite"
- }
- })
- ],
- 1
- )
- ]
- ),
- _vm._v(" "),
- _vm.flylineLengths[i]
- ? _c(
- "use",
- {
- attrs: {
- "xlink:href": "#" + line.key,
- "stroke-width": line.width,
- stroke: line.color,
- mask: "url(#mask" + _vm.unique + line.key + ")"
- }
- },
- [
- _c("animate", {
- attrs: {
- attributeName: "stroke-dasharray",
- from: "0, " + _vm.flylineLengths[i],
- to: _vm.flylineLengths[i] + ", 0",
- dur: line.time,
- repeatCount: "indefinite"
- }
- })
- ]
- )
- : _vm._e()
- ])
- })
- ],
- 2
- )
- : _vm._e()
- ]
- )
- };
- var __vue_staticRenderFns__$y = [];
- __vue_render__$y._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$y = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$y = undefined;
- /* module identifier */
- const __vue_module_identifier__$y = undefined;
- /* functional template */
- const __vue_is_functional_template__$y = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$y = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$y, staticRenderFns: __vue_staticRenderFns__$y },
- __vue_inject_styles__$y,
- __vue_script__$y,
- __vue_scope_id__$y,
- __vue_is_functional_template__$y,
- __vue_module_identifier__$y,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function flylineChartEnhanced (Vue) {
- Vue.component(__vue_component__$y.name, __vue_component__$y);
- }
-
- //
- var script$z = {
- name: 'DvConicalColumnChart',
- mixins: [autoResize],
- props: {
- config: {
- type: Object,
- default: () => ({})
- }
- },
-
- data() {
- return {
- ref: 'conical-column-chart',
- defaultConfig: {
- /**
- * @description Chart data
- * @type {Array<Object>}
- * @default data = []
- */
- data: [],
-
- /**
- * @description Chart img
- * @type {Array<String>}
- * @default img = []
- */
- img: [],
-
- /**
- * @description Chart font size
- * @type {Number}
- * @default fontSize = 12
- */
- fontSize: 12,
-
- /**
- * @description Img side length
- * @type {Number}
- * @default imgSideLength = 30
- */
- imgSideLength: 30,
-
- /**
- * @description Column color
- * @type {String}
- * @default columnColor = 'rgba(0, 194, 255, 0.4)'
- */
- columnColor: 'rgba(0, 194, 255, 0.4)',
-
- /**
- * @description Text color
- * @type {String}
- * @default textColor = '#fff'
- */
- textColor: '#fff',
-
- /**
- * @description Show value
- * @type {Boolean}
- * @default showValue = false
- */
- showValue: false
- },
- mergedConfig: null,
- column: []
- };
- },
-
- watch: {
- config() {
- const {
- calcData
- } = this;
- calcData();
- }
-
- },
- methods: {
- afterAutoResizeMixinInit() {
- const {
- calcData
- } = this;
- calcData();
- },
-
- onResize() {
- const {
- calcData
- } = this;
- calcData();
- },
-
- calcData() {
- const {
- mergeConfig,
- initData,
- calcSVGPath
- } = this;
- mergeConfig();
- initData();
- calcSVGPath();
- },
-
- mergeConfig() {
- const {
- defaultConfig,
- config
- } = this;
- this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
- },
-
- initData() {
- const {
- mergedConfig
- } = this;
- let {
- data
- } = mergedConfig;
- data = util_1(data, true);
- data.sort(({
- value: a
- }, {
- value: b
- }) => {
- if (a > b) return -1;
- if (a < b) return 1;
- if (a === b) return 0;
- });
- const max = data[0] ? data[0].value : 10;
- data = data.map(item => ({ ...item,
- percent: item.value / max
- }));
- mergedConfig.data = data;
- },
-
- calcSVGPath() {
- const {
- mergedConfig,
- width,
- height
- } = this;
- const {
- imgSideLength,
- fontSize,
- data
- } = mergedConfig;
- const itemNum = data.length;
- const gap = width / (itemNum + 1);
- const useAbleHeight = height - imgSideLength - fontSize - 5;
- const svgBottom = height - fontSize - 5;
- this.column = data.map((item, i) => {
- const {
- percent
- } = item;
- const middleXPos = gap * (i + 1);
- const leftXPos = gap * i;
- const rightXpos = gap * (i + 2);
- const middleYPos = svgBottom - useAbleHeight * percent;
- const controlYPos = useAbleHeight * percent * 0.6 + middleYPos;
- const d = `
- M${leftXPos}, ${svgBottom}
- Q${middleXPos}, ${controlYPos} ${middleXPos},${middleYPos}
- M${middleXPos},${middleYPos}
- Q${middleXPos}, ${controlYPos} ${rightXpos},${svgBottom}
- L${leftXPos}, ${svgBottom}
- Z
- `;
- const textY = (svgBottom + middleYPos) / 2 + fontSize / 2;
- return { ...item,
- d,
- x: middleXPos,
- y: middleYPos,
- textY
- };
- });
- }
-
- }
- };
-
- /* script */
- const __vue_script__$z = script$z;
-
- /* template */
- var __vue_render__$z = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-conical-column-chart" }, [
- _c(
- "svg",
- { attrs: { width: _vm.width, height: _vm.height } },
- _vm._l(_vm.column, function(item, i) {
- return _c("g", { key: i }, [
- _c("path", {
- attrs: { d: item.d, fill: _vm.mergedConfig.columnColor }
- }),
- _vm._v(" "),
- _c(
- "text",
- {
- style: "fontSize:" + _vm.mergedConfig.fontSize + "px",
- attrs: {
- fill: _vm.mergedConfig.textColor,
- x: item.x,
- y: _vm.height - 4
- }
- },
- [_vm._v("\n " + _vm._s(item.name) + "\n ")]
- ),
- _vm._v(" "),
- _vm.mergedConfig.img.length
- ? _c("image", {
- attrs: {
- "xlink:href":
- _vm.mergedConfig.img[i % _vm.mergedConfig.img.length],
- width: _vm.mergedConfig.imgSideLength,
- height: _vm.mergedConfig.imgSideLength,
- x: item.x - _vm.mergedConfig.imgSideLength / 2,
- y: item.y - _vm.mergedConfig.imgSideLength
- }
- })
- : _vm._e(),
- _vm._v(" "),
- _vm.mergedConfig.showValue
- ? _c(
- "text",
- {
- style: "fontSize:" + _vm.mergedConfig.fontSize + "px",
- attrs: {
- fill: _vm.mergedConfig.textColor,
- x: item.x,
- y: item.textY
- }
- },
- [_vm._v("\n " + _vm._s(item.value) + "\n ")]
- )
- : _vm._e()
- ])
- }),
- 0
- )
- ])
- };
- var __vue_staticRenderFns__$z = [];
- __vue_render__$z._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$z = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$z = undefined;
- /* module identifier */
- const __vue_module_identifier__$z = undefined;
- /* functional template */
- const __vue_is_functional_template__$z = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$z = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$z, staticRenderFns: __vue_staticRenderFns__$z },
- __vue_inject_styles__$z,
- __vue_script__$z,
- __vue_scope_id__$z,
- __vue_is_functional_template__$z,
- __vue_module_identifier__$z,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function conicalColumnChart (Vue) {
- Vue.component(__vue_component__$z.name, __vue_component__$z);
- }
-
- function digitalFlop (Vue) {
- Vue.component(__vue_component__$s.name, __vue_component__$s);
- }
-
- //
- var script$A = {
- name: 'DvScrollBoard',
- mixins: [autoResize],
- props: {
- config: {
- type: Object,
- default: () => ({})
- }
- },
-
- data() {
- return {
- ref: 'scroll-board',
- defaultConfig: {
- /**
- * @description Board header
- * @type {Array<String>}
- * @default header = []
- * @example header = ['column1', 'column2', 'column3']
- */
- header: [],
-
- /**
- * @description Board data
- * @type {Array<Array>}
- * @default data = []
- */
- data: [],
-
- /**
- * @description Row num
- * @type {Number}
- * @default rowNum = 5
- */
- rowNum: 5,
-
- /**
- * @description Header background color
- * @type {String}
- * @default headerBGC = '#00BAFF'
- */
- headerBGC: '#00BAFF',
-
- /**
- * @description Odd row background color
- * @type {String}
- * @default oddRowBGC = '#003B51'
- */
- oddRowBGC: '#003B51',
-
- /**
- * @description Even row background color
- * @type {String}
- * @default evenRowBGC = '#003B51'
- */
- evenRowBGC: '#0A2732',
-
- /**
- * @description Scroll wait time
- * @type {Number}
- * @default waitTime = 2000
- */
- waitTime: 2000,
-
- /**
- * @description Header height
- * @type {Number}
- * @default headerHeight = 35
- */
- headerHeight: 35,
-
- /**
- * @description Column width
- * @type {Array<Number>}
- * @default columnWidth = []
- */
- columnWidth: [],
-
- /**
- * @description Column align
- * @type {Array<String>}
- * @default align = []
- * @example align = ['left', 'center', 'right']
- */
- align: [],
-
- /**
- * @description Show index
- * @type {Boolean}
- * @default index = false
- */
- index: false,
-
- /**
- * @description index Header
- * @type {String}
- * @default indexHeader = '#'
- */
- indexHeader: '#',
-
- /**
- * @description Carousel type
- * @type {String}
- * @default carousel = 'single'
- * @example carousel = 'single' | 'page'
- */
- carousel: 'single',
-
- /**
- * @description Pause scroll when mouse hovered
- * @type {Boolean}
- * @default hoverPause = true
- * @example hoverPause = true | false
- */
- hoverPause: true
- },
- mergedConfig: null,
- header: [],
- rowsData: [],
- rows: [],
- widths: [],
- heights: [],
- avgHeight: 0,
- aligns: [],
- animationIndex: 0,
- animationHandler: '',
- updater: 0,
- needCalc: false
- };
- },
-
- watch: {
- config() {
- const {
- stopAnimation,
- calcData
- } = this;
- stopAnimation();
- this.animationIndex = 0;
- calcData();
- }
-
- },
- methods: {
- handleHover(enter, ri, ci, row, ceil) {
- const {
- mergedConfig,
- emitEvent,
- stopAnimation,
- animation
- } = this;
- if (enter) emitEvent('mouseover', ri, ci, row, ceil);
- if (!mergedConfig.hoverPause) return;
-
- if (enter) {
- stopAnimation();
- } else {
- animation(true);
- }
- },
-
- afterAutoResizeMixinInit() {
- const {
- calcData
- } = this;
- calcData();
- },
-
- onResize() {
- const {
- mergedConfig,
- calcWidths,
- calcHeights
- } = this;
- if (!mergedConfig) return;
- calcWidths();
- calcHeights();
- },
-
- calcData() {
- const {
- mergeConfig,
- calcHeaderData,
- calcRowsData
- } = this;
- mergeConfig();
- calcHeaderData();
- calcRowsData();
- const {
- calcWidths,
- calcHeights,
- calcAligns
- } = this;
- calcWidths();
- calcHeights();
- calcAligns();
- const {
- animation
- } = this;
- animation(true);
- },
-
- mergeConfig() {
- let {
- config,
- defaultConfig
- } = this;
- this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
- },
-
- calcHeaderData() {
- let {
- header,
- index,
- indexHeader
- } = this.mergedConfig;
-
- if (!header.length) {
- this.header = [];
- return;
- }
-
- header = [...header];
- if (index) header.unshift(indexHeader);
- this.header = header;
- },
-
- calcRowsData() {
- let {
- data,
- index,
- headerBGC,
- rowNum
- } = this.mergedConfig;
-
- if (index) {
- data = data.map((row, i) => {
- row = [...row];
- const indexTag = `<span class="index" style="background-color: ${headerBGC};">${i + 1}</span>`;
- row.unshift(indexTag);
- return row;
- });
- }
-
- data = data.map((ceils, i) => ({
- ceils,
- rowIndex: i
- }));
- const rowLength = data.length;
-
- if (rowLength > rowNum && rowLength < 2 * rowNum) {
- data = [...data, ...data];
- }
-
- data = data.map((d, i) => ({ ...d,
- scroll: i
- }));
- this.rowsData = data;
- this.rows = data;
- },
-
- calcWidths() {
- const {
- width,
- mergedConfig,
- rowsData
- } = this;
- const {
- columnWidth,
- header
- } = mergedConfig;
- const usedWidth = columnWidth.reduce((all, w) => all + w, 0);
- let columnNum = 0;
-
- if (rowsData[0]) {
- columnNum = rowsData[0].ceils.length;
- } else if (header.length) {
- columnNum = header.length;
- }
-
- const avgWidth = (width - usedWidth) / (columnNum - columnWidth.length);
- const widths = new Array(columnNum).fill(avgWidth);
- this.widths = util_2$1(widths, columnWidth);
- },
-
- calcHeights(onresize = false) {
- const {
- height,
- mergedConfig,
- header
- } = this;
- const {
- headerHeight,
- rowNum,
- data
- } = mergedConfig;
- let allHeight = height;
- if (header.length) allHeight -= headerHeight;
- const avgHeight = allHeight / rowNum;
- this.avgHeight = avgHeight;
- if (!onresize) this.heights = new Array(data.length).fill(avgHeight);
- },
-
- calcAligns() {
- const {
- header,
- mergedConfig
- } = this;
- const columnNum = header.length;
- let aligns = new Array(columnNum).fill('left');
- const {
- align
- } = mergedConfig;
- this.aligns = util_2$1(aligns, align);
- },
-
- async animation(start = false) {
- const {
- needCalc,
- calcHeights,
- calcRowsData
- } = this;
-
- if (needCalc) {
- calcRowsData();
- calcHeights();
- this.needCalc = false;
- }
-
- let {
- avgHeight,
- animationIndex,
- mergedConfig,
- rowsData,
- animation,
- updater
- } = this;
- const {
- waitTime,
- carousel,
- rowNum
- } = mergedConfig;
- const rowLength = rowsData.length;
- if (rowNum >= rowLength) return;
-
- if (start) {
- await new Promise(resolve => setTimeout(resolve, waitTime));
- if (updater !== this.updater) return;
- }
-
- const animationNum = carousel === 'single' ? 1 : rowNum;
- let rows = rowsData.slice(animationIndex);
- rows.push(...rowsData.slice(0, animationIndex));
- this.rows = rows.slice(0, carousel === 'page' ? rowNum * 2 : rowNum + 1);
- this.heights = new Array(rowLength).fill(avgHeight);
- await new Promise(resolve => setTimeout(resolve, 300));
- if (updater !== this.updater) return;
- this.heights.splice(0, animationNum, ...new Array(animationNum).fill(0));
- animationIndex += animationNum;
- const back = animationIndex - rowLength;
- if (back >= 0) animationIndex = back;
- this.animationIndex = animationIndex;
- this.$emit('scroll-change', animationIndex);
- this.animationHandler = setTimeout(animation, waitTime - 300);
- },
-
- stopAnimation() {
- const {
- animationHandler,
- updater
- } = this;
- this.updater = (updater + 1) % 999999;
- if (!animationHandler) return;
- clearTimeout(animationHandler);
- },
-
- emitEvent(type, ri, ci, row, ceil) {
- const {
- ceils,
- rowIndex
- } = row;
- this.$emit(type, {
- row: ceils,
- ceil,
- rowIndex,
- columnIndex: ci
- });
- },
-
- updateRows(rows, animationIndex) {
- const {
- mergedConfig,
- animationHandler,
- animation
- } = this;
- this.mergedConfig = { ...mergedConfig,
- data: [...rows]
- };
- this.needCalc = true;
- if (typeof animationIndex === 'number') this.animationIndex = animationIndex;
- if (!animationHandler) animation(true);
- }
-
- },
-
- destroyed() {
- const {
- stopAnimation
- } = this;
- stopAnimation();
- }
-
- };
-
- /* script */
- const __vue_script__$A = script$A;
-
- /* template */
- var __vue_render__$A = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c("div", { ref: _vm.ref, staticClass: "dv-scroll-board" }, [
- _vm.header.length && _vm.mergedConfig
- ? _c(
- "div",
- {
- staticClass: "header",
- style: "background-color: " + _vm.mergedConfig.headerBGC + ";"
- },
- _vm._l(_vm.header, function(headerItem, i) {
- return _c("div", {
- key: "" + headerItem + i,
- staticClass: "header-item",
- style:
- "\n height: " +
- _vm.mergedConfig.headerHeight +
- "px;\n line-height: " +
- _vm.mergedConfig.headerHeight +
- "px;\n width: " +
- _vm.widths[i] +
- "px;\n ",
- attrs: { align: _vm.aligns[i] },
- domProps: { innerHTML: _vm._s(headerItem) }
- })
- }),
- 0
- )
- : _vm._e(),
- _vm._v(" "),
- _vm.mergedConfig
- ? _c(
- "div",
- {
- staticClass: "rows",
- style:
- "height: " +
- (_vm.height -
- (_vm.header.length ? _vm.mergedConfig.headerHeight : 0)) +
- "px;"
- },
- _vm._l(_vm.rows, function(row, ri) {
- return _c(
- "div",
- {
- key: "" + row.toString() + row.scroll,
- staticClass: "row-item",
- style:
- "\n height: " +
- _vm.heights[ri] +
- "px;\n line-height: " +
- _vm.heights[ri] +
- "px;\n background-color: " +
- _vm.mergedConfig[
- row.rowIndex % 2 === 0 ? "evenRowBGC" : "oddRowBGC"
- ] +
- ";\n "
- },
- _vm._l(row.ceils, function(ceil, ci) {
- return _c("div", {
- key: "" + ceil + ri + ci,
- staticClass: "ceil",
- style: "width: " + _vm.widths[ci] + "px;",
- attrs: { align: _vm.aligns[ci] },
- domProps: { innerHTML: _vm._s(ceil) },
- on: {
- click: function($event) {
- return _vm.emitEvent("click", ri, ci, row, ceil)
- },
- mouseenter: function($event) {
- return _vm.handleHover(true, ri, ci, row, ceil)
- },
- mouseleave: function($event) {
- return _vm.handleHover(false)
- }
- }
- })
- }),
- 0
- )
- }),
- 0
- )
- : _vm._e()
- ])
- };
- var __vue_staticRenderFns__$A = [];
- __vue_render__$A._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$A = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$A = undefined;
- /* module identifier */
- const __vue_module_identifier__$A = undefined;
- /* functional template */
- const __vue_is_functional_template__$A = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$A = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$A, staticRenderFns: __vue_staticRenderFns__$A },
- __vue_inject_styles__$A,
- __vue_script__$A,
- __vue_scope_id__$A,
- __vue_is_functional_template__$A,
- __vue_module_identifier__$A,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function scrollBoard (Vue) {
- Vue.component(__vue_component__$A.name, __vue_component__$A);
- }
-
- //
- var script$B = {
- name: 'DvScrollRankingBoard',
- mixins: [autoResize],
- props: {
- config: {
- type: Object,
- default: () => ({})
- }
- },
-
- data() {
- return {
- ref: 'scroll-ranking-board',
- defaultConfig: {
- /**
- * @description Board data
- * @type {Array<Object>}
- * @default data = []
- */
- data: [],
-
- /**
- * @description Row num
- * @type {Number}
- * @default rowNum = 5
- */
- rowNum: 5,
-
- /**
- * @description Scroll wait time
- * @type {Number}
- * @default waitTime = 2000
- */
- waitTime: 2000,
-
- /**
- * @description Carousel type
- * @type {String}
- * @default carousel = 'single'
- * @example carousel = 'single' | 'page'
- */
- carousel: 'single',
-
- /**
- * @description Value unit
- * @type {String}
- * @default unit = ''
- * @example unit = 'ton'
- */
- unit: '',
-
- /**
- * @description Auto sort by value
- * @type {Boolean}
- * @default sort = true
- */
- sort: true,
-
- /**
- * @description Value formatter
- * @type {Function}
- * @default valueFormatter = null
- */
- valueFormatter: null
- },
- mergedConfig: null,
- rowsData: [],
- rows: [],
- heights: [],
- animationIndex: 0,
- animationHandler: '',
- updater: 0
- };
- },
-
- watch: {
- config() {
- const {
- stopAnimation,
- calcData
- } = this;
- stopAnimation();
- calcData();
- }
-
- },
- methods: {
- afterAutoResizeMixinInit() {
- const {
- calcData
- } = this;
- calcData();
- },
-
- onResize() {
- const {
- mergedConfig,
- calcHeights
- } = this;
- if (!mergedConfig) return;
- calcHeights(true);
- },
-
- calcData() {
- const {
- mergeConfig,
- calcRowsData
- } = this;
- mergeConfig();
- calcRowsData();
- const {
- calcHeights
- } = this;
- calcHeights();
- const {
- animation
- } = this;
- animation(true);
- },
-
- mergeConfig() {
- let {
- config,
- defaultConfig
- } = this;
- this.mergedConfig = util_2$1(util_1(defaultConfig, true), config || {});
- },
-
- calcRowsData() {
- let {
- data,
- rowNum,
- sort
- } = this.mergedConfig;
- sort && data.sort(({
- value: a
- }, {
- value: b
- }) => {
- if (a > b) return -1;
- if (a < b) return 1;
- if (a === b) return 0;
- });
- const value = data.map(({
- value
- }) => value);
- const min = Math.min(...value) || 0; // abs of min
-
- const minAbs = Math.abs(min);
- const max = Math.max(...value) || 0; // abs of max
- const total = max + minAbs;
- data = data.map((row, i) => ({ ...row,
- ranking: i + 1,
- percent: (row.value + minAbs) / total * 100
- }));
- const rowLength = data.length;
-
- if (rowLength > rowNum && rowLength < 2 * rowNum) {
- data = [...data, ...data];
- }
-
- data = data.map((d, i) => ({ ...d,
- scroll: i
- }));
- this.rowsData = data;
- this.rows = data;
- },
-
- calcHeights(onresize = false) {
- const {
- height,
- mergedConfig
- } = this;
- const {
- rowNum,
- data
- } = mergedConfig;
- const avgHeight = height / rowNum;
- this.avgHeight = avgHeight;
- if (!onresize) this.heights = new Array(data.length).fill(avgHeight);
- },
-
- async animation(start = false) {
- let {
- avgHeight,
- animationIndex,
- mergedConfig,
- rowsData,
- animation,
- updater
- } = this;
- const {
- waitTime,
- carousel,
- rowNum
- } = mergedConfig;
- const rowLength = rowsData.length;
- if (rowNum >= rowLength) return;
-
- if (start) {
- await new Promise(resolve => setTimeout(resolve, waitTime));
- if (updater !== this.updater) return;
- }
-
- const animationNum = carousel === 'single' ? 1 : rowNum;
- let rows = rowsData.slice(animationIndex);
- rows.push(...rowsData.slice(0, animationIndex));
- this.rows = rows.slice(0, rowNum + 1);
- this.heights = new Array(rowLength).fill(avgHeight);
- await new Promise(resolve => setTimeout(resolve, 300));
- if (updater !== this.updater) return;
- this.heights.splice(0, animationNum, ...new Array(animationNum).fill(0));
- animationIndex += animationNum;
- const back = animationIndex - rowLength;
- if (back >= 0) animationIndex = back;
- this.animationIndex = animationIndex;
- this.animationHandler = setTimeout(animation, waitTime - 300);
- },
-
- stopAnimation() {
- const {
- animationHandler,
- updater
- } = this;
- this.updater = (updater + 1) % 999999;
- if (!animationHandler) return;
- clearTimeout(animationHandler);
- }
-
- },
-
- destroyed() {
- const {
- stopAnimation
- } = this;
- stopAnimation();
- }
-
- };
-
- /* script */
- const __vue_script__$B = script$B;
-
- /* template */
- var __vue_render__$B = function() {
- var _vm = this;
- var _h = _vm.$createElement;
- var _c = _vm._self._c || _h;
- return _c(
- "div",
- { ref: _vm.ref, staticClass: "dv-scroll-ranking-board" },
- _vm._l(_vm.rows, function(item, i) {
- return _c(
- "div",
- {
- key: item.toString() + item.scroll,
- staticClass: "row-item",
- style: "height: " + _vm.heights[i] + "px;"
- },
- [
- _c("div", { staticClass: "ranking-info" }, [
- _c("div", { staticClass: "rank" }, [
- _vm._v("No." + _vm._s(item.ranking))
- ]),
- _vm._v(" "),
- _c("div", {
- staticClass: "info-name",
- domProps: { innerHTML: _vm._s(item.name) }
- }),
- _vm._v(" "),
- _c("div", { staticClass: "ranking-value" }, [
- _vm._v(
- _vm._s(
- _vm.mergedConfig.valueFormatter
- ? _vm.mergedConfig.valueFormatter(item)
- : item.value + _vm.mergedConfig.unit
- )
- )
- ])
- ]),
- _vm._v(" "),
- _c("div", { staticClass: "ranking-column" }, [
- _c(
- "div",
- {
- staticClass: "inside-column",
- style: "width: " + item.percent + "%;"
- },
- [_c("div", { staticClass: "shine" })]
- )
- ])
- ]
- )
- }),
- 0
- )
- };
- var __vue_staticRenderFns__$B = [];
- __vue_render__$B._withStripped = true;
-
- /* style */
- const __vue_inject_styles__$B = function (inject) {
- if (!inject) return
- 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 });
-
- };
- /* scoped */
- const __vue_scope_id__$B = undefined;
- /* module identifier */
- const __vue_module_identifier__$B = undefined;
- /* functional template */
- const __vue_is_functional_template__$B = false;
- /* style inject SSR */
-
- /* style inject shadow dom */
-
-
-
- const __vue_component__$B = /*#__PURE__*/normalizeComponent(
- { render: __vue_render__$B, staticRenderFns: __vue_staticRenderFns__$B },
- __vue_inject_styles__$B,
- __vue_script__$B,
- __vue_scope_id__$B,
- __vue_is_functional_template__$B,
- __vue_module_identifier__$B,
- false,
- createInjector,
- undefined,
- undefined
- );
-
- function scrollRankingBoard (Vue) {
- Vue.component(__vue_component__$B.name, __vue_component__$B);
- }
-
- /**
- * IMPORT COMPONENTS
- */
- /**
- * USE COMPONENTS
- */
-
- function datav (Vue) {
- Vue.use(fullScreenContainer);
- Vue.use(loading); // border box
-
- Vue.use(borderBox1);
- Vue.use(borderBox2);
- Vue.use(borderBox3);
- Vue.use(borderBox4);
- Vue.use(borderBox5);
- Vue.use(borderBox6);
- Vue.use(borderBox7);
- Vue.use(borderBox8);
- Vue.use(borderBox9);
- Vue.use(borderBox10);
- Vue.use(borderBox11);
- Vue.use(borderBox12);
- Vue.use(borderBox13); // decoration
-
- Vue.use(decoration1);
- Vue.use(decoration2);
- Vue.use(decoration3);
- Vue.use(decoration4);
- Vue.use(decoration5);
- Vue.use(decoration6);
- Vue.use(decoration7);
- Vue.use(decoration8);
- Vue.use(decoration9);
- Vue.use(decoration10);
- Vue.use(decoration11);
- Vue.use(decoration12); // charts
-
- Vue.use(charts);
- Vue.use(activeRingChart);
- Vue.use(capsuleChart);
- Vue.use(waterLevelPond);
- Vue.use(percentPond);
- Vue.use(flylineChart);
- Vue.use(flylineChartEnhanced);
- Vue.use(conicalColumnChart);
- Vue.use(digitalFlop);
- Vue.use(scrollBoard);
- Vue.use(scrollRankingBoard);
- }
-
- Vue.use(datav);
-
- })));
-
|