1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251 |
- (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);
- })));
|