1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486 |
- (function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory();
- else if(typeof define === 'function' && define.amd)
- define([], factory);
- else if(typeof exports === 'object')
- exports["G"] = factory();
- else
- root["G"] = factory();
- })(window, function() {
- return /******/ (function(modules) { // webpackBootstrap
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId]) {
- /******/ return installedModules[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /******/
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
- /******/ }
- /******/ };
- /******/
- /******/ // define __esModule on exports
- /******/ __webpack_require__.r = function(exports) {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/
- /******/ // create a fake namespace object
- /******/ // mode & 1: value is a module id, require it
- /******/ // mode & 2: merge all properties of value into the ns
- /******/ // mode & 4: return value when already ns object
- /******/ // mode & 8|1: behave like require
- /******/ __webpack_require__.t = function(value, mode) {
- /******/ if(mode & 1) value = __webpack_require__(value);
- /******/ if(mode & 8) return value;
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
- /******/ var ns = Object.create(null);
- /******/ __webpack_require__.r(ns);
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
- /******/ return ns;
- /******/ };
- /******/
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "";
- /******/
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts");
- /******/ })
- /************************************************************************/
- /******/ ({
- /***/ "./node_modules/_@antv_event-emitter@0.1.2@@antv/event-emitter/esm/index.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/_@antv_event-emitter@0.1.2@@antv/event-emitter/esm/index.js ***!
- \**********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var WILDCARD = '*';
- /* event-emitter */
- var EventEmitter =
- /** @class */
- function () {
- function EventEmitter() {
- this._events = {};
- }
- /**
- * 监听一个事件
- * @param evt
- * @param callback
- * @param once
- */
- EventEmitter.prototype.on = function (evt, callback, once) {
- if (!this._events[evt]) {
- this._events[evt] = [];
- }
- this._events[evt].push({
- callback: callback,
- once: !!once
- });
- return this;
- };
- /**
- * 监听一个事件一次
- * @param evt
- * @param callback
- */
- EventEmitter.prototype.once = function (evt, callback) {
- this.on(evt, callback, true);
- return this;
- };
- /**
- * 触发一个事件
- * @param evt
- * @param args
- */
- EventEmitter.prototype.emit = function (evt) {
- var _this = this;
- var args = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- args[_i - 1] = arguments[_i];
- }
- var events = this._events[evt] || [];
- var wildcardEvents = this._events[WILDCARD] || []; // 实际的处理 emit 方法
- var doEmit = function (es) {
- var length = es.length;
- for (var i = 0; i < length; i++) {
- if (!es[i]) {
- continue;
- }
- var _a = es[i],
- callback = _a.callback,
- once = _a.once;
- if (once) {
- es.splice(i, 1);
- if (es.length === 0) {
- delete _this._events[evt];
- }
- length--;
- i--;
- }
- callback.apply(_this, args);
- }
- };
- doEmit(events);
- doEmit(wildcardEvents);
- };
- /**
- * 取消监听一个事件,或者一个channel
- * @param evt
- * @param callback
- */
- EventEmitter.prototype.off = function (evt, callback) {
- if (!evt) {
- // evt 为空全部清除
- this._events = {};
- } else {
- if (!callback) {
- // evt 存在,callback 为空,清除事件所有方法
- delete this._events[evt];
- } else {
- // evt 存在,callback 存在,清除匹配的
- var events = this._events[evt] || [];
- var length_1 = events.length;
- for (var i = 0; i < length_1; i++) {
- if (events[i].callback === callback) {
- events.splice(i, 1);
- length_1--;
- i--;
- }
- }
- if (events.length === 0) {
- delete this._events[evt];
- }
- }
- }
- return this;
- };
- /* 当前所有的事件 */
- EventEmitter.prototype.getEvents = function () {
- return this._events;
- };
- return EventEmitter;
- }();
- /* harmony default export */ __webpack_exports__["default"] = (EventEmitter);
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/base.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/base.js ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- /* harmony import */ var _antv_event_emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/event-emitter */ "./node_modules/_@antv_event-emitter@0.1.2@@antv/event-emitter/esm/index.js");
- /* harmony import */ var _util_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/util.js");
- var Base =
- /** @class */
- function (_super) {
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Base, _super);
- function Base(cfg) {
- var _this = _super.call(this) || this;
- /**
- * 是否被销毁
- * @type {boolean}
- */
- _this.destroyed = false;
- var defaultCfg = _this.getDefaultCfg();
- _this.cfg = Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["mix"])(defaultCfg, cfg);
- return _this;
- }
- /**
- * @protected
- * 默认的配置项
- * @returns {object} 默认的配置项
- */
- Base.prototype.getDefaultCfg = function () {
- return {};
- }; // 实现接口的方法
- Base.prototype.get = function (name) {
- return this.cfg[name];
- }; // 实现接口的方法
- Base.prototype.set = function (name, value) {
- this.cfg[name] = value;
- }; // 实现接口的方法
- Base.prototype.destroy = function () {
- this.cfg = {
- destroyed: true
- };
- this.off();
- this.destroyed = true;
- };
- return Base;
- }(_antv_event_emitter__WEBPACK_IMPORTED_MODULE_1__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (Base);
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/canvas.js":
- /*!*************************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/canvas.js ***!
- \*************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- /* harmony import */ var detect_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! detect-browser */ "./node_modules/_detect-browser@5.1.0@detect-browser/index.js");
- /* harmony import */ var detect_browser__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(detect_browser__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/container.js");
- /* harmony import */ var _util_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/util.js");
- /* harmony import */ var _animate_timeline__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../animate/timeline */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/animate/timeline.js");
- /* harmony import */ var _event_event_contoller__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../event/event-contoller */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/event/event-contoller.js");
- var PX_SUFFIX = 'px';
- var browser = Object(detect_browser__WEBPACK_IMPORTED_MODULE_1__["detect"])();
- var isFirefox = browser && browser.name === 'firefox';
- var Canvas =
- /** @class */
- function (_super) {
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Canvas, _super);
- function Canvas(cfg) {
- var _this = _super.call(this, cfg) || this;
- _this.initContainer();
- _this.initDom();
- _this.initEvents();
- _this.initTimeline();
- return _this;
- }
- Canvas.prototype.getDefaultCfg = function () {
- var cfg = _super.prototype.getDefaultCfg.call(this); // set default cursor style for canvas
- cfg['cursor'] = 'default'; // CSS transform 目前尚未经过长时间验证,为了避免影响上层业务,默认关闭,上层按需开启
- cfg['supportCSSTransform'] = false;
- return cfg;
- };
- /**
- * @protected
- * 初始化容器
- */
- Canvas.prototype.initContainer = function () {
- var container = this.get('container');
- if (Object(_util_util__WEBPACK_IMPORTED_MODULE_3__["isString"])(container)) {
- container = document.getElementById(container);
- this.set('container', container);
- }
- };
- /**
- * @protected
- * 初始化 DOM
- */
- Canvas.prototype.initDom = function () {
- var el = this.createDom();
- this.set('el', el); // 附加到容器
- var container = this.get('container');
- container.appendChild(el); // 设置初始宽度
- this.setDOMSize(this.get('width'), this.get('height'));
- };
- /**
- * @protected
- * 初始化绑定的事件
- */
- Canvas.prototype.initEvents = function () {
- var eventController = new _event_event_contoller__WEBPACK_IMPORTED_MODULE_5__["default"]({
- canvas: this
- });
- eventController.init();
- this.set('eventController', eventController);
- };
- /**
- * @protected
- * 初始化时间轴
- */
- Canvas.prototype.initTimeline = function () {
- var timeline = new _animate_timeline__WEBPACK_IMPORTED_MODULE_4__["default"](this);
- this.set('timeline', timeline);
- };
- /**
- * @protected
- * 修改画布对应的 DOM 的大小
- * @param {number} width 宽度
- * @param {number} height 高度
- */
- Canvas.prototype.setDOMSize = function (width, height) {
- var el = this.get('el');
- if (_util_util__WEBPACK_IMPORTED_MODULE_3__["isBrowser"]) {
- el.style.width = width + PX_SUFFIX;
- el.style.height = height + PX_SUFFIX;
- }
- }; // 实现接口
- Canvas.prototype.changeSize = function (width, height) {
- this.setDOMSize(width, height);
- this.set('width', width);
- this.set('height', height);
- this.onCanvasChange('changeSize');
- };
- /**
- * 获取当前的渲染引擎
- * @return {Renderer} 返回当前的渲染引擎
- */
- Canvas.prototype.getRenderer = function () {
- return this.get('renderer');
- };
- /**
- * 获取画布的 cursor 样式
- * @return {Cursor}
- */
- Canvas.prototype.getCursor = function () {
- return this.get('cursor');
- };
- /**
- * 设置画布的 cursor 样式
- * @param {Cursor} cursor cursor 样式
- */
- Canvas.prototype.setCursor = function (cursor) {
- this.set('cursor', cursor);
- var el = this.get('el');
- if (_util_util__WEBPACK_IMPORTED_MODULE_3__["isBrowser"] && el) {
- // 直接设置样式,不等待鼠标移动时再设置
- el.style.cursor = cursor;
- }
- }; // 实现接口
- Canvas.prototype.getPointByEvent = function (ev) {
- var supportCSSTransform = this.get('supportCSSTransform');
- if (supportCSSTransform) {
- // For Firefox <= 38
- if (isFirefox && !Object(_util_util__WEBPACK_IMPORTED_MODULE_3__["isNil"])(ev.layerX) && ev.layerX !== ev.offsetX) {
- return {
- x: ev.layerX,
- y: ev.layerY
- };
- }
- if (!Object(_util_util__WEBPACK_IMPORTED_MODULE_3__["isNil"])(ev.offsetX)) {
- // For IE6+, Firefox >= 39, Chrome, Safari, Opera
- return {
- x: ev.offsetX,
- y: ev.offsetY
- };
- }
- } // should calculate by self for other cases, like Safari in ios
- // TODO: support CSS transform
- var _a = this.getClientByEvent(ev),
- clientX = _a.x,
- clientY = _a.y;
- return this.getPointByClient(clientX, clientY);
- }; // 获取 touch 事件的 clientX 和 clientY 需要单独处理
- Canvas.prototype.getClientByEvent = function (ev) {
- var clientInfo = ev;
- if (ev.touches) {
- if (ev.type === 'touchend') {
- clientInfo = ev.changedTouches[0];
- } else {
- clientInfo = ev.touches[0];
- }
- }
- return {
- x: clientInfo.clientX,
- y: clientInfo.clientY
- };
- }; // 实现接口
- Canvas.prototype.getPointByClient = function (clientX, clientY) {
- var el = this.get('el');
- var bbox = el.getBoundingClientRect();
- return {
- x: clientX - bbox.left,
- y: clientY - bbox.top
- };
- }; // 实现接口
- Canvas.prototype.getClientByPoint = function (x, y) {
- var el = this.get('el');
- var bbox = el.getBoundingClientRect();
- return {
- x: x + bbox.left,
- y: y + bbox.top
- };
- }; // 实现接口
- Canvas.prototype.draw = function () {};
- /**
- * @protected
- * 销毁 DOM 容器
- */
- Canvas.prototype.removeDom = function () {
- var el = this.get('el');
- el.parentNode.removeChild(el);
- };
- /**
- * @protected
- * 清理所有的事件
- */
- Canvas.prototype.clearEvents = function () {
- var eventController = this.get('eventController');
- eventController.destroy();
- };
- Canvas.prototype.isCanvas = function () {
- return true;
- };
- Canvas.prototype.getParent = function () {
- return null;
- };
- Canvas.prototype.destroy = function () {
- var timeline = this.get('timeline');
- if (this.get('destroyed')) {
- return;
- }
- this.clear(); // 同初始化时相反顺序调用
- if (timeline) {
- // 画布销毁时自动停止动画
- timeline.stop();
- }
- this.clearEvents();
- this.removeDom();
- _super.prototype.destroy.call(this);
- };
- return Canvas;
- }(_container__WEBPACK_IMPORTED_MODULE_2__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (Canvas);
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/container.js":
- /*!****************************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/container.js ***!
- \****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/element.js");
- /* harmony import */ var _util_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/util.js");
- var SHAPE_MAP = {};
- var INDEX = '_INDEX';
- /**
- * 设置 canvas
- * @param {IElement} element 元素
- * @param {ICanvas} canvas 画布
- */
- function setCanvas(element, canvas) {
- element.set('canvas', canvas);
- if (element.isGroup()) {
- var children = element.get('children');
- if (children.length) {
- children.forEach(function (child) {
- setCanvas(child, canvas);
- });
- }
- }
- }
- /**
- * 设置 timeline
- * @param {IElement} element 元素
- * @param {Timeline} timeline 时间轴
- */
- function setTimeline(element, timeline) {
- element.set('timeline', timeline);
- if (element.isGroup()) {
- var children = element.get('children');
- if (children.length) {
- children.forEach(function (child) {
- setTimeline(child, timeline);
- });
- }
- }
- }
- function contains(container, element) {
- var children = container.getChildren();
- return children.indexOf(element) >= 0;
- }
- function removeChild(container, element, destroy) {
- if (destroy === void 0) {
- destroy = true;
- } // 不再调用 element.remove() 方法,会出现循环调用
- if (destroy) {
- element.destroy();
- } else {
- element.set('parent', null);
- element.set('canvas', null);
- }
- Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["removeFromArray"])(container.getChildren(), element);
- }
- function getComparer(compare) {
- return function (left, right) {
- var result = compare(left, right);
- return result === 0 ? left[INDEX] - right[INDEX] : result;
- };
- }
- var Container =
- /** @class */
- function (_super) {
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Container, _super);
- function Container() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Container.prototype.isCanvas = function () {
- return false;
- }; // 根据子节点确定 BBox
- Container.prototype.getBBox = function () {
- // 所有的值可能在画布的可视区外
- var minX = Infinity;
- var maxX = -Infinity;
- var minY = Infinity;
- var maxY = -Infinity;
- var xArr = [];
- var yArr = []; // 将可见元素、图形以及不为空的图形分组筛选出来,用于包围盒合并
- var children = this.getChildren().filter(function (child) {
- return child.get('visible') && (!child.isGroup() || child.isGroup() && child.getChildren().length > 0);
- });
- if (children.length > 0) {
- Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["each"])(children, function (child) {
- var box = child.getBBox();
- xArr.push(box.minX, box.maxX);
- yArr.push(box.minY, box.maxY);
- });
- minX = Math.min.apply(null, xArr);
- maxX = Math.max.apply(null, xArr);
- minY = Math.min.apply(null, yArr);
- maxY = Math.max.apply(null, yArr);
- } else {
- minX = 0;
- maxX = 0;
- minY = 0;
- maxY = 0;
- }
- var box = {
- x: minX,
- y: minY,
- minX: minX,
- minY: minY,
- maxX: maxX,
- maxY: maxY,
- width: maxX - minX,
- height: maxY - minY
- };
- return box;
- }; // 获取画布的包围盒
- Container.prototype.getCanvasBBox = function () {
- var minX = Infinity;
- var maxX = -Infinity;
- var minY = Infinity;
- var maxY = -Infinity;
- var xArr = [];
- var yArr = []; // 将可见元素、图形以及不为空的图形分组筛选出来,用于包围盒合并
- var children = this.getChildren().filter(function (child) {
- return child.get('visible') && (!child.isGroup() || child.isGroup() && child.getChildren().length > 0);
- });
- if (children.length > 0) {
- Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["each"])(children, function (child) {
- var box = child.getCanvasBBox();
- xArr.push(box.minX, box.maxX);
- yArr.push(box.minY, box.maxY);
- });
- minX = Math.min.apply(null, xArr);
- maxX = Math.max.apply(null, xArr);
- minY = Math.min.apply(null, yArr);
- maxY = Math.max.apply(null, yArr);
- } else {
- minX = 0;
- maxX = 0;
- minY = 0;
- maxY = 0;
- }
- var box = {
- x: minX,
- y: minY,
- minX: minX,
- minY: minY,
- maxX: maxX,
- maxY: maxY,
- width: maxX - minX,
- height: maxY - minY
- };
- return box;
- };
- Container.prototype.getDefaultCfg = function () {
- var cfg = _super.prototype.getDefaultCfg.call(this);
- cfg['children'] = [];
- return cfg;
- };
- Container.prototype.onAttrChange = function (name, value, originValue) {
- _super.prototype.onAttrChange.call(this, name, value, originValue);
- if (name === 'matrix') {
- var totalMatrix = this.getTotalMatrix();
- this._applyChildrenMarix(totalMatrix);
- }
- }; // 不但应用到自己身上还要应用于子元素
- Container.prototype.applyMatrix = function (matrix) {
- var preTotalMatrix = this.getTotalMatrix();
- _super.prototype.applyMatrix.call(this, matrix);
- var totalMatrix = this.getTotalMatrix(); // totalMatrix 没有发生变化时,这里仅考虑两者都为 null 时
- // 不继续向下传递矩阵
- if (totalMatrix === preTotalMatrix) {
- return;
- }
- this._applyChildrenMarix(totalMatrix);
- }; // 在子元素上设置矩阵
- Container.prototype._applyChildrenMarix = function (totalMatrix) {
- var children = this.getChildren();
- Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["each"])(children, function (child) {
- child.applyMatrix(totalMatrix);
- });
- }; // 兼容老版本的接口
- Container.prototype.addShape = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- var type = args[0];
- var cfg = args[1];
- if (Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["isObject"])(type)) {
- cfg = type;
- } else {
- cfg['type'] = type;
- }
- var shapeType = SHAPE_MAP[cfg.type];
- if (!shapeType) {
- shapeType = Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["upperFirst"])(cfg.type);
- SHAPE_MAP[cfg.type] = shapeType;
- }
- var ShapeBase = this.getShapeBase();
- var shape = new ShapeBase[shapeType](cfg);
- this.add(shape);
- return shape;
- };
- Container.prototype.addGroup = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- var groupClass = args[0],
- cfg = args[1];
- var group;
- if (Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(groupClass)) {
- if (cfg) {
- group = new groupClass(cfg);
- } else {
- group = new groupClass({
- // canvas,
- parent: this
- });
- }
- } else {
- var tmpCfg = groupClass || {};
- var TmpGroupClass = this.getGroupBase();
- group = new TmpGroupClass(tmpCfg);
- }
- this.add(group);
- return group;
- };
- Container.prototype.getCanvas = function () {
- var canvas;
- if (this.isCanvas()) {
- canvas = this;
- } else {
- canvas = this.get('canvas');
- }
- return canvas;
- };
- Container.prototype.getShape = function (x, y, ev) {
- // 如果不支持拾取,则直接返回
- if (!Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["isAllowCapture"])(this)) {
- return null;
- }
- var children = this.getChildren();
- var shape; // 如果容器是 group
- if (!this.isCanvas()) {
- var v = [x, y, 1]; // 将 x, y 转换成对应于 group 的局部坐标
- v = this.invertFromMatrix(v);
- if (!this.isClipped(v[0], v[1])) {
- shape = this._findShape(children, v[0], v[1], ev);
- }
- } else {
- shape = this._findShape(children, x, y, ev);
- }
- return shape;
- };
- Container.prototype._findShape = function (children, x, y, ev) {
- var shape = null;
- for (var i = children.length - 1; i >= 0; i--) {
- var child = children[i];
- if (Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["isAllowCapture"])(child)) {
- if (child.isGroup()) {
- shape = child.getShape(x, y, ev);
- } else if (child.isHit(x, y)) {
- shape = child;
- }
- }
- if (shape) {
- break;
- }
- }
- return shape;
- };
- Container.prototype.add = function (element) {
- var canvas = this.getCanvas();
- var children = this.getChildren();
- var timeline = this.get('timeline');
- var preParent = element.getParent();
- if (preParent) {
- removeChild(preParent, element, false);
- }
- element.set('parent', this);
- if (canvas) {
- setCanvas(element, canvas);
- }
- if (timeline) {
- setTimeline(element, timeline);
- }
- children.push(element);
- element.onCanvasChange('add');
- this._applyElementMatrix(element);
- }; // 将当前容器的矩阵应用到子元素
- Container.prototype._applyElementMatrix = function (element) {
- var totalMatrix = this.getTotalMatrix(); // 添加图形或者分组时,需要把当前图元的矩阵设置进去
- if (totalMatrix) {
- element.applyMatrix(totalMatrix);
- }
- };
- Container.prototype.getChildren = function () {
- return this.get('children');
- };
- Container.prototype.sort = function () {
- var children = this.getChildren(); // 稳定排序
- Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["each"])(children, function (child, index) {
- child[INDEX] = index;
- return child;
- });
- children.sort(getComparer(function (obj1, obj2) {
- return obj1.get('zIndex') - obj2.get('zIndex');
- }));
- this.onCanvasChange('sort');
- };
- Container.prototype.clear = function () {
- this.set('clearing', true);
- if (this.destroyed) {
- return;
- }
- var children = this.getChildren();
- for (var i = children.length - 1; i >= 0; i--) {
- children[i].destroy(); // 销毁子元素
- }
- this.set('children', []);
- this.onCanvasChange('clear');
- this.set('clearing', false);
- };
- Container.prototype.destroy = function () {
- if (this.get('destroyed')) {
- return;
- }
- this.clear();
- _super.prototype.destroy.call(this);
- };
- /**
- * 获取第一个子元素
- * @return {IElement} 第一个元素
- */
- Container.prototype.getFirst = function () {
- return this.getChildByIndex(0);
- };
- /**
- * 获取最后一个子元素
- * @return {IElement} 元素
- */
- Container.prototype.getLast = function () {
- var children = this.getChildren();
- return this.getChildByIndex(children.length - 1);
- };
- /**
- * 根据索引获取子元素
- * @return {IElement} 第一个元素
- */
- Container.prototype.getChildByIndex = function (index) {
- var children = this.getChildren();
- return children[index];
- };
- /**
- * 子元素的数量
- * @return {number} 子元素数量
- */
- Container.prototype.getCount = function () {
- var children = this.getChildren();
- return children.length;
- };
- /**
- * 是否包含对应元素
- * @param {IElement} element 元素
- * @return {boolean}
- */
- Container.prototype.contain = function (element) {
- var children = this.getChildren();
- return children.indexOf(element) > -1;
- };
- /**
- * 移除对应子元素
- * @param {IElement} element 子元素
- * @param {boolean} destroy 是否销毁子元素,默认为 true
- */
- Container.prototype.removeChild = function (element, destroy) {
- if (destroy === void 0) {
- destroy = true;
- }
- if (this.contain(element)) {
- element.remove(destroy);
- }
- };
- /**
- * 查找所有匹配的元素
- * @param {ElementFilterFn} fn 匹配函数
- * @return {IElement[]} 元素数组
- */
- Container.prototype.findAll = function (fn) {
- var rst = [];
- var children = this.getChildren();
- Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["each"])(children, function (element) {
- if (fn(element)) {
- rst.push(element);
- }
- if (element.isGroup()) {
- rst = rst.concat(element.findAll(fn));
- }
- });
- return rst;
- };
- /**
- * 查找元素,找到第一个返回
- * @param {ElementFilterFn} fn 匹配函数
- * @return {IElement|null} 元素,可以为空
- */
- Container.prototype.find = function (fn) {
- var rst = null;
- var children = this.getChildren();
- Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["each"])(children, function (element) {
- if (fn(element)) {
- rst = element;
- } else if (element.isGroup()) {
- rst = element.find(fn);
- }
- if (rst) {
- return false;
- }
- });
- return rst;
- };
- /**
- * 根据 ID 查找元素
- * @param {string} id 元素 id
- * @return {IElement|null} 元素
- */
- Container.prototype.findById = function (id) {
- return this.find(function (element) {
- return element.get('id') === id;
- });
- };
- /**
- * 该方法即将废弃,不建议使用
- * 根据 className 查找元素
- * TODO: 该方式定义暂时只给 G6 3.3 以后的版本使用,待 G6 中的 findByClassName 方法移除后,G 也需要同步移除
- * @param {string} className 元素 className
- * @return {IElement | null} 元素
- */
- Container.prototype.findByClassName = function (className) {
- return this.find(function (element) {
- return element.get('className') === className;
- });
- };
- /**
- * 根据 name 查找元素列表
- * @param {string} name 元素名称
- * @return {IElement[]} 元素
- */
- Container.prototype.findAllByName = function (name) {
- return this.findAll(function (element) {
- return element.get('name') === name;
- });
- };
- return Container;
- }(_element__WEBPACK_IMPORTED_MODULE_1__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (Container);
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/element.js":
- /*!**************************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/element.js ***!
- \**************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- /* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
- /* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/matrix-util */ "./node_modules/_@antv_matrix-util@3.1.0-beta.2@@antv/matrix-util/esm/index.js");
- /* harmony import */ var _util_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/util.js");
- /* harmony import */ var _util_matrix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/matrix */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/matrix.js");
- /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./base */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/base.js");
- var MATRIX = 'matrix';
- var CLONE_CFGS = ['zIndex', 'capture', 'visible', 'type']; // 可以在 toAttrs 中设置,但不属于绘图属性的字段
- var RESERVED_PORPS = ['repeat'];
- var DELEGATION_SPLIT = ':';
- var WILDCARD = '*'; // 需要考虑数组嵌套数组的场景
- // 数组嵌套对象的场景不考虑
- function _cloneArrayAttr(arr) {
- var result = [];
- for (var i = 0; i < arr.length; i++) {
- if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isArray"])(arr[i])) {
- result.push([].concat(arr[i]));
- } else {
- result.push(arr[i]);
- }
- }
- return result;
- }
- function getFormatFromAttrs(toAttrs, shape) {
- var fromAttrs = {};
- var attrs = shape.attrs;
- for (var k in toAttrs) {
- fromAttrs[k] = attrs[k];
- }
- return fromAttrs;
- }
- function getFormatToAttrs(props, shape) {
- var toAttrs = {};
- var attrs = shape.attr();
- Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(props, function (v, k) {
- if (RESERVED_PORPS.indexOf(k) === -1 && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isEqual"])(attrs[k], v)) {
- toAttrs[k] = v;
- }
- });
- return toAttrs;
- }
- function checkExistedAttrs(animations, animation) {
- if (animation.onFrame) {
- return animations;
- }
- var startTime = animation.startTime,
- delay = animation.delay,
- duration = animation.duration;
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(animations, function (item) {
- // 后一个动画开始执行的时间 < 前一个动画的结束时间 && 后一个动画的执行时间 > 前一个动画的延迟
- if (startTime + delay < item.startTime + item.delay + item.duration && duration > item.delay) {
- Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(animation.toAttrs, function (v, k) {
- if (hasOwnProperty.call(item.toAttrs, k)) {
- delete item.toAttrs[k];
- delete item.fromAttrs[k];
- }
- });
- }
- });
- return animations;
- }
- var Element =
- /** @class */
- function (_super) {
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Element, _super);
- function Element(cfg) {
- var _this = _super.call(this, cfg) || this;
- /**
- * @protected
- * 图形属性
- * @type {ShapeAttrs}
- */
- _this.attrs = {};
- var attrs = _this.getDefaultAttrs();
- Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["mix"])(attrs, cfg.attrs);
- _this.attrs = attrs;
- _this.initAttrs(attrs);
- _this.initAnimate(); // 初始化动画
- return _this;
- } // override
- Element.prototype.getDefaultCfg = function () {
- return {
- visible: true,
- capture: true,
- zIndex: 0
- };
- };
- /**
- * @protected
- * 获取默认的属相
- */
- Element.prototype.getDefaultAttrs = function () {
- return {
- matrix: this.getDefaultMatrix(),
- opacity: 1
- };
- };
- /**
- * @protected
- * 一些方法调用会引起画布变化
- * @param {ChangeType} changeType 改变的类型
- */
- Element.prototype.onCanvasChange = function (changeType) {};
- /**
- * @protected
- * 初始化属性,有些属性需要加工
- * @param {object} attrs 属性值
- */
- Element.prototype.initAttrs = function (attrs) {};
- /**
- * @protected
- * 初始化动画
- */
- Element.prototype.initAnimate = function () {
- this.set('animable', true);
- this.set('animating', false);
- };
- Element.prototype.isGroup = function () {
- return false;
- };
- Element.prototype.getParent = function () {
- return this.get('parent');
- };
- Element.prototype.getCanvas = function () {
- return this.get('canvas');
- };
- Element.prototype.attr = function () {
- var _a;
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- var name = args[0],
- value = args[1];
- if (!name) return this.attrs;
- if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(name)) {
- for (var k in name) {
- this.setAttr(k, name[k]);
- }
- this.afterAttrsChange(name);
- return this;
- }
- if (args.length === 2) {
- this.setAttr(name, value);
- this.afterAttrsChange((_a = {}, _a[name] = value, _a));
- return this;
- }
- return this.attrs[name];
- }; // 是否被裁剪,被裁剪则不显示,不参与拾取
- Element.prototype.isClipped = function (refX, refY) {
- var clip = this.getClip();
- return clip && !clip.isHit(refX, refY);
- };
- /**
- * 内部设置属性值的接口
- * @param {string} name 属性名
- * @param {any} value 属性值
- */
- Element.prototype.setAttr = function (name, value) {
- var originValue = this.attrs[name];
- if (originValue !== value) {
- this.attrs[name] = value;
- this.onAttrChange(name, value, originValue);
- }
- };
- /**
- * @protected
- * 属性值发生改变
- * @param {string} name 属性名
- * @param {any} value 属性值
- * @param {any} originValue 属性值
- */
- Element.prototype.onAttrChange = function (name, value, originValue) {
- if (name === 'matrix') {
- this.set('totalMatrix', null);
- }
- };
- /**
- * 属性更改后需要做的事情
- * @protected
- */
- Element.prototype.afterAttrsChange = function (targetAttrs) {
- if (this.cfg.isClipShape) {
- var applyTo = this.cfg.applyTo;
- if (applyTo) {
- applyTo.onCanvasChange('clip');
- }
- } else {
- this.onCanvasChange('attr');
- }
- };
- Element.prototype.show = function () {
- // 不是高频操作直接使用 set
- this.set('visible', true);
- this.onCanvasChange('show');
- return this;
- };
- Element.prototype.hide = function () {
- // 不是高频操作直接使用 set
- this.set('visible', false);
- this.onCanvasChange('hide');
- return this;
- };
- Element.prototype.setZIndex = function (zIndex) {
- this.set('zIndex', zIndex);
- var parent = this.getParent();
- if (parent) {
- // 改变 zIndex 不应该立即触发渲染 (调用 onCanvasChange('zIndex')),需要经过 sort 再触发
- parent.sort();
- }
- return this;
- };
- Element.prototype.toFront = function () {
- var parent = this.getParent();
- if (!parent) {
- return;
- }
- var children = parent.getChildren();
- var el = this.get('el');
- var index = children.indexOf(this);
- children.splice(index, 1);
- children.push(this);
- this.onCanvasChange('zIndex');
- };
- Element.prototype.toBack = function () {
- var parent = this.getParent();
- if (!parent) {
- return;
- }
- var children = parent.getChildren();
- var el = this.get('el');
- var index = children.indexOf(this);
- children.splice(index, 1);
- children.unshift(this);
- this.onCanvasChange('zIndex');
- };
- Element.prototype.remove = function (destroy) {
- if (destroy === void 0) {
- destroy = true;
- }
- var parent = this.getParent();
- if (parent) {
- Object(_util_util__WEBPACK_IMPORTED_MODULE_3__["removeFromArray"])(parent.getChildren(), this);
- if (!parent.get('clearing')) {
- // 如果父元素正在清理,当前元素不触发 remove
- this.onCanvasChange('remove');
- }
- } else {
- this.onCanvasChange('remove');
- }
- if (destroy) {
- this.destroy();
- }
- };
- Element.prototype.resetMatrix = function () {
- this.attr(MATRIX, this.getDefaultMatrix());
- this.onCanvasChange('matrix');
- };
- Element.prototype.getMatrix = function () {
- return this.attr(MATRIX);
- };
- Element.prototype.setMatrix = function (m) {
- this.attr(MATRIX, m);
- this.onCanvasChange('matrix');
- }; // 获取总的 matrix
- Element.prototype.getTotalMatrix = function () {
- var totalMatrix = this.cfg.totalMatrix;
- if (!totalMatrix) {
- var currentMatrix = this.attr('matrix');
- var parentMatrix = this.cfg.parentMatrix;
- if (parentMatrix && currentMatrix) {
- totalMatrix = Object(_util_matrix__WEBPACK_IMPORTED_MODULE_4__["multiplyMatrix"])(parentMatrix, currentMatrix);
- } else {
- totalMatrix = currentMatrix || parentMatrix;
- }
- this.set('totalMatrix', totalMatrix);
- }
- return totalMatrix;
- }; // 上层分组设置 matrix
- Element.prototype.applyMatrix = function (matrix) {
- var currentMatrix = this.attr('matrix');
- var totalMatrix = null;
- if (matrix && currentMatrix) {
- totalMatrix = Object(_util_matrix__WEBPACK_IMPORTED_MODULE_4__["multiplyMatrix"])(matrix, currentMatrix);
- } else {
- totalMatrix = currentMatrix || matrix;
- }
- this.set('totalMatrix', totalMatrix);
- this.set('parentMatrix', matrix);
- };
- /**
- * @protected
- * 获取默认的矩阵
- * @returns {number[]|null} 默认的矩阵
- */
- Element.prototype.getDefaultMatrix = function () {
- return null;
- }; // 将向量应用设置的矩阵
- Element.prototype.applyToMatrix = function (v) {
- var matrix = this.attr('matrix');
- if (matrix) {
- return Object(_util_matrix__WEBPACK_IMPORTED_MODULE_4__["multiplyVec2"])(matrix, v);
- }
- return v;
- }; // 根据设置的矩阵,将向量转换相对于图形/分组的位置
- Element.prototype.invertFromMatrix = function (v) {
- var matrix = this.attr('matrix');
- if (matrix) {
- var invertMatrix = Object(_util_matrix__WEBPACK_IMPORTED_MODULE_4__["invert"])(matrix);
- if (invertMatrix) {
- return Object(_util_matrix__WEBPACK_IMPORTED_MODULE_4__["multiplyVec2"])(invertMatrix, v);
- }
- }
- return v;
- }; // 设置 clip
- Element.prototype.setClip = function (clipCfg) {
- var canvas = this.getCanvas(); // 应该只设置当前元素的 clip,不应该去修改 clip 本身,方便 clip 被复用
- // TODO: setClip 的传参既 shape 配置,也支持 shape 对象
- // const preShape = this.get('clipShape');
- // if (preShape) {
- // // 将之前的 clipShape 销毁
- // preShape.destroy();
- // }
- var clipShape = null; // 如果配置项为 null,则不移除 clipShape
- if (clipCfg) {
- var ShapeBase = this.getShapeBase();
- var shapeType = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["upperFirst"])(clipCfg.type);
- var Cons = ShapeBase[shapeType];
- if (Cons) {
- clipShape = new Cons({
- type: clipCfg.type,
- isClipShape: true,
- applyTo: this,
- attrs: clipCfg.attrs,
- canvas: canvas
- });
- }
- }
- this.set('clipShape', clipShape);
- this.onCanvasChange('clip');
- return clipShape;
- };
- Element.prototype.getClip = function () {
- // 高频率调用的地方直接使用 this.cfg.xxx
- var clipShape = this.cfg.clipShape; // 未设置时返回 Null,保证一致性
- if (!clipShape) {
- return null;
- }
- return clipShape;
- };
- Element.prototype.clone = function () {
- var _this = this;
- var originAttrs = this.attrs;
- var attrs = {};
- Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(originAttrs, function (i, k) {
- if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isArray"])(originAttrs[k])) {
- attrs[k] = _cloneArrayAttr(originAttrs[k]);
- } else {
- attrs[k] = originAttrs[k];
- }
- });
- var cons = this.constructor; // @ts-ignore
- var clone = new cons({
- attrs: attrs
- });
- Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(CLONE_CFGS, function (cfgName) {
- clone.set(cfgName, _this.get(cfgName));
- });
- return clone;
- };
- Element.prototype.destroy = function () {
- var destroyed = this.destroyed;
- if (destroyed) {
- return;
- }
- this.attrs = {};
- _super.prototype.destroy.call(this); // this.onCanvasChange('destroy');
- };
- /**
- * 是否处于动画暂停状态
- * @return {boolean} 是否处于动画暂停状态
- */
- Element.prototype.isAnimatePaused = function () {
- return this.get('_pause').isPaused;
- };
- /**
- * 执行动画,支持多种函数签名
- * 1. animate(toAttrs: ElementAttrs, duration: number, easing?: string, callback?: () => void, delay?: number)
- * 2. animate(onFrame: OnFrame, duration: number, easing?: string, callback?: () => void, delay?: number)
- * 3. animate(toAttrs: ElementAttrs, cfg: AnimateCfg)
- * 4. animate(onFrame: OnFrame, cfg: AnimateCfg)
- * 各个参数的含义为:
- * toAttrs 动画最终状态
- * onFrame 自定义帧动画函数
- * duration 动画执行时间
- * easing 动画缓动效果
- * callback 动画执行后的回调
- * delay 动画延迟时间
- */
- Element.prototype.animate = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- this.set('animating', true);
- var timeline = this.get('timeline');
- if (!timeline) {
- timeline = this.get('canvas').get('timeline');
- this.set('timeline', timeline);
- }
- var animations = this.get('animations') || []; // 初始化 tick
- if (!timeline.timer) {
- timeline.initTimer();
- }
- var toAttrs = args[0],
- duration = args[1],
- _a = args[2],
- easing = _a === void 0 ? 'easeLinear' : _a,
- _b = args[3],
- callback = _b === void 0 ? _antv_util__WEBPACK_IMPORTED_MODULE_1__["noop"] : _b,
- _c = args[4],
- delay = _c === void 0 ? 0 : _c;
- var onFrame;
- var repeat;
- var pauseCallback;
- var resumeCallback;
- var animateCfg; // 第二个参数,既可以是动画最终状态 toAttrs,也可以是自定义帧动画函数 onFrame
- if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(toAttrs)) {
- onFrame = toAttrs;
- toAttrs = {};
- } else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(toAttrs) && toAttrs.onFrame) {
- // 兼容 3.0 中的写法,onFrame 和 repeat 可在 toAttrs 中设置
- onFrame = toAttrs.onFrame;
- repeat = toAttrs.repeat;
- } // 第二个参数,既可以是执行时间 duration,也可以是动画参数 animateCfg
- if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(duration)) {
- animateCfg = duration;
- duration = animateCfg.duration;
- easing = animateCfg.easing || 'easeLinear';
- delay = animateCfg.delay || 0; // animateCfg 中的设置优先级更高
- repeat = animateCfg.repeat || repeat || false;
- callback = animateCfg.callback || _antv_util__WEBPACK_IMPORTED_MODULE_1__["noop"];
- pauseCallback = animateCfg.pauseCallback || _antv_util__WEBPACK_IMPORTED_MODULE_1__["noop"];
- resumeCallback = animateCfg.resumeCallback || _antv_util__WEBPACK_IMPORTED_MODULE_1__["noop"];
- } else {
- // 第四个参数,既可以是回调函数 callback,也可以是延迟时间 delay
- if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(callback)) {
- delay = callback;
- callback = null;
- } // 第三个参数,既可以是缓动参数 easing,也可以是回调函数 callback
- if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(easing)) {
- callback = easing;
- easing = 'easeLinear';
- } else {
- easing = easing || 'easeLinear';
- }
- }
- var formatToAttrs = getFormatToAttrs(toAttrs, this);
- var animation = {
- fromAttrs: getFormatFromAttrs(formatToAttrs, this),
- toAttrs: formatToAttrs,
- duration: duration,
- easing: easing,
- repeat: repeat,
- callback: callback,
- pauseCallback: pauseCallback,
- resumeCallback: resumeCallback,
- delay: delay,
- startTime: timeline.getTime(),
- id: Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["uniqueId"])(),
- onFrame: onFrame,
- pathFormatted: false
- }; // 如果动画元素队列中已经有这个图形了
- if (animations.length > 0) {
- // 先检查是否需要合并属性。若有相同的动画,将该属性从前一个动画中删除,直接用后一个动画中
- animations = checkExistedAttrs(animations, animation);
- } else {
- // 否则将图形添加到动画元素队列
- timeline.addAnimator(this);
- }
- animations.push(animation);
- this.set('animations', animations);
- this.set('_pause', {
- isPaused: false
- });
- };
- /**
- * 停止动画
- * @param {boolean} toEnd 是否到动画的最终状态
- */
- Element.prototype.stopAnimate = function (toEnd) {
- var _this = this;
- if (toEnd === void 0) {
- toEnd = true;
- }
- var animations = this.get('animations');
- Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(animations, function (animation) {
- // 将动画执行到最后一帧
- if (toEnd) {
- if (animation.onFrame) {
- _this.attr(animation.onFrame(1));
- } else {
- _this.attr(animation.toAttrs);
- }
- }
- if (animation.callback) {
- // 动画停止时的回调
- animation.callback();
- }
- });
- this.set('animating', false);
- this.set('animations', []);
- };
- /**
- * 暂停动画
- */
- Element.prototype.pauseAnimate = function () {
- var timeline = this.get('timeline');
- var animations = this.get('animations');
- var pauseTime = timeline.getTime();
- Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(animations, function (animation) {
- animation._paused = true;
- animation._pauseTime = pauseTime;
- if (animation.pauseCallback) {
- // 动画暂停时的回调
- animation.pauseCallback();
- }
- }); // 记录下是在什么时候暂停的
- this.set('_pause', {
- isPaused: true,
- pauseTime: pauseTime
- });
- return this;
- };
- /**
- * 恢复动画
- */
- Element.prototype.resumeAnimate = function () {
- var timeline = this.get('timeline');
- var current = timeline.getTime();
- var animations = this.get('animations');
- var pauseTime = this.get('_pause').pauseTime; // 之后更新属性需要计算动画已经执行的时长,如果暂停了,就把初始时间调后
- Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(animations, function (animation) {
- animation.startTime = animation.startTime + (current - pauseTime);
- animation._paused = false;
- animation._pauseTime = null;
- if (animation.resumeCallback) {
- animation.resumeCallback();
- }
- });
- this.set('_pause', {
- isPaused: false
- });
- this.set('animations', animations);
- return this;
- };
- /**
- * 触发委托事件
- * @param {string} type 事件类型
- * @param {GraphEvent} eventObj 事件对象
- */
- Element.prototype.emitDelegation = function (type, eventObj) {
- var _this = this;
- var paths = eventObj.propagationPath;
- var events = this.getEvents();
- var relativeShape;
- if (type === 'mouseenter') {
- relativeShape = eventObj.fromShape;
- } else if (type === 'mouseleave') {
- relativeShape = eventObj.toShape;
- }
- var _loop_1 = function (i) {
- var element = paths[i]; // 暂定跟 name 绑定
- var name_1 = element.get('name');
- if (name_1) {
- // 第一个 mouseenter 和 mouseleave 的停止即可,因为后面的都是前面的 Parent
- if ( // 只有 element 是 Group 或者 Canvas 的时候,才需要判断 isParent
- (element.isGroup() || element.isCanvas && element.isCanvas()) && relativeShape && Object(_util_util__WEBPACK_IMPORTED_MODULE_3__["isParent"])(element, relativeShape)) {
- return "break";
- }
- if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isArray"])(name_1)) {
- Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(name_1, function (subName) {
- _this.emitDelegateEvent(element, subName, eventObj);
- });
- } else {
- this_1.emitDelegateEvent(element, name_1, eventObj);
- }
- }
- };
- var this_1 = this; // 至少有一个对象,且第一个对象为 shape
- for (var i = 0; i < paths.length; i++) {
- var state_1 = _loop_1(i);
- if (state_1 === "break") break;
- }
- };
- Element.prototype.emitDelegateEvent = function (element, name, eventObj) {
- var events = this.getEvents(); // 事件委托的形式 name:type
- var eventName = name + DELEGATION_SPLIT + eventObj.type;
- if (events[eventName] || events[WILDCARD]) {
- // 对于通配符 *,事件名称 = 委托事件名称
- eventObj.name = eventName;
- eventObj.currentTarget = element;
- eventObj.delegateTarget = this; // 将委托事件的监听对象 delegateObject 挂载到事件对象上
- eventObj.delegateObject = element.get('delegateObject');
- this.emit(eventName, eventObj);
- }
- };
- /**
- * 移动元素
- * @param {number} translateX 水平移动距离
- * @param {number} translateY 垂直移动距离
- * @return {IElement} 元素
- */
- Element.prototype.translate = function (translateX, translateY) {
- if (translateX === void 0) {
- translateX = 0;
- }
- if (translateY === void 0) {
- translateY = 0;
- }
- var matrix = this.getMatrix();
- var newMatrix = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__["ext"].transform(matrix, [['t', translateX, translateY]]);
- this.setMatrix(newMatrix);
- return this;
- };
- /**
- * 移动元素到目标位置
- * @param {number} targetX 目标位置的水平坐标
- * @param {number} targetX 目标位置的垂直坐标
- * @return {IElement} 元素
- */
- Element.prototype.move = function (targetX, targetY) {
- var x = this.attr('x') || 0;
- var y = this.attr('y') || 0;
- this.translate(targetX - x, targetY - y);
- return this;
- };
- /**
- * 移动元素到目标位置,等价于 move 方法。由于 moveTo 的语义性更强,因此在文档中推荐使用 moveTo 方法
- * @param {number} targetX 目标位置的 x 轴坐标
- * @param {number} targetY 目标位置的 y 轴坐标
- * @return {IElement} 元素
- */
- Element.prototype.moveTo = function (targetX, targetY) {
- return this.move(targetX, targetY);
- };
- /**
- * 缩放元素
- * @param {number} ratioX 水平缩放比例
- * @param {number} ratioY 垂直缩放比例
- * @return {IElement} 元素
- */
- Element.prototype.scale = function (ratioX, ratioY) {
- var matrix = this.getMatrix();
- var newMatrix = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__["ext"].transform(matrix, [['s', ratioX, ratioY || ratioX]]);
- this.setMatrix(newMatrix);
- return this;
- };
- /**
- * 以画布左上角 (0, 0) 为中心旋转元素
- * @param {number} radian 旋转角度(弧度值)
- * @return {IElement} 元素
- */
- Element.prototype.rotate = function (radian) {
- var matrix = this.getMatrix();
- var newMatrix = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__["ext"].transform(matrix, [['r', radian]]);
- this.setMatrix(newMatrix);
- return this;
- };
- /**
- * 以起始点为中心旋转元素
- * @param {number} radian 旋转角度(弧度值)
- * @return {IElement} 元素
- */
- Element.prototype.rotateAtStart = function (rotate) {
- var _a = this.attr(),
- x = _a.x,
- y = _a.y;
- var matrix = this.getMatrix();
- var newMatrix = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__["ext"].transform(matrix, [['t', -x, -y], ['r', rotate], ['t', x, y]]);
- this.setMatrix(newMatrix);
- return this;
- };
- /**
- * 以任意点 (x, y) 为中心旋转元素
- * @param {number} radian 旋转角度(弧度值)
- * @return {IElement} 元素
- */
- Element.prototype.rotateAtPoint = function (x, y, rotate) {
- var matrix = this.getMatrix();
- var newMatrix = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__["ext"].transform(matrix, [['t', -x, -y], ['r', rotate], ['t', x, y]]);
- this.setMatrix(newMatrix);
- return this;
- };
- return Element;
- }(_base__WEBPACK_IMPORTED_MODULE_5__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (Element);
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/group.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/group.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- /* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./container */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/container.js");
- var AbstractGroup =
- /** @class */
- function (_super) {
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(AbstractGroup, _super);
- function AbstractGroup() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AbstractGroup.prototype.isGroup = function () {
- return true;
- };
- AbstractGroup.prototype.isEntityGroup = function () {
- return false;
- };
- AbstractGroup.prototype.clone = function () {
- var clone = _super.prototype.clone.call(this); // 获取构造函数
- var children = this.getChildren();
- for (var i = 0; i < children.length; i++) {
- var child = children[i];
- clone.add(child.clone());
- }
- return clone;
- };
- return AbstractGroup;
- }(_container__WEBPACK_IMPORTED_MODULE_1__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (AbstractGroup);
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/shape.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/shape.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/element.js");
- /* harmony import */ var _util_matrix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/matrix */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/matrix.js");
- var AbstractShape =
- /** @class */
- function (_super) {
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(AbstractShape, _super);
- function AbstractShape(cfg) {
- return _super.call(this, cfg) || this;
- } // 是否在包围盒内
- AbstractShape.prototype._isInBBox = function (refX, refY) {
- var bbox = this.getBBox();
- return bbox.minX <= refX && bbox.maxX >= refX && bbox.minY <= refY && bbox.maxY >= refY;
- };
- /**
- * 属性更改后需要做的事情
- * @protected
- * @param {ShapeAttrs} targetAttrs 渲染的图像属性
- */
- AbstractShape.prototype.afterAttrsChange = function (targetAttrs) {
- _super.prototype.afterAttrsChange.call(this, targetAttrs);
- this.clearCacheBBox();
- }; // 计算包围盒时,需要缓存,这是一个高频的操作
- AbstractShape.prototype.getBBox = function () {
- var bbox = this.cfg.bbox;
- if (!bbox) {
- bbox = this.calculateBBox();
- this.set('bbox', bbox);
- }
- return bbox;
- }; // 计算相对于画布的包围盒
- AbstractShape.prototype.getCanvasBBox = function () {
- var canvasBBox = this.cfg.canvasBBox;
- if (!canvasBBox) {
- canvasBBox = this.calculateCanvasBBox();
- this.set('canvasBBox', canvasBBox);
- }
- return canvasBBox;
- };
- AbstractShape.prototype.applyMatrix = function (matrix) {
- _super.prototype.applyMatrix.call(this, matrix); // 清理掉缓存的包围盒
- this.set('canvasBBox', null);
- };
- /**
- * 计算相对于画布的包围盒,默认等同于 bbox
- * @return {BBox} 包围盒
- */
- AbstractShape.prototype.calculateCanvasBBox = function () {
- var bbox = this.getBBox();
- var totalMatrix = this.getTotalMatrix();
- var minX = bbox.minX,
- minY = bbox.minY,
- maxX = bbox.maxX,
- maxY = bbox.maxY;
- if (totalMatrix) {
- var topLeft = Object(_util_matrix__WEBPACK_IMPORTED_MODULE_2__["multiplyVec2"])(totalMatrix, [bbox.minX, bbox.minY]);
- var topRight = Object(_util_matrix__WEBPACK_IMPORTED_MODULE_2__["multiplyVec2"])(totalMatrix, [bbox.maxX, bbox.minY]);
- var bottomLeft = Object(_util_matrix__WEBPACK_IMPORTED_MODULE_2__["multiplyVec2"])(totalMatrix, [bbox.minX, bbox.maxY]);
- var bottomRight = Object(_util_matrix__WEBPACK_IMPORTED_MODULE_2__["multiplyVec2"])(totalMatrix, [bbox.maxX, bbox.maxY]);
- minX = Math.min(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]);
- maxX = Math.max(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]);
- minY = Math.min(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]);
- maxY = Math.max(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]);
- }
- var attrs = this.attrs; // 如果存在 shadow 则计算 shadow
- if (attrs.shadowColor) {
- var _a = attrs.shadowBlur,
- shadowBlur = _a === void 0 ? 0 : _a,
- _b = attrs.shadowOffsetX,
- shadowOffsetX = _b === void 0 ? 0 : _b,
- _c = attrs.shadowOffsetY,
- shadowOffsetY = _c === void 0 ? 0 : _c;
- var shadowLeft = minX - shadowBlur + shadowOffsetX;
- var shadowRight = maxX + shadowBlur + shadowOffsetX;
- var shadowTop = minY - shadowBlur + shadowOffsetY;
- var shadowBottom = maxY + shadowBlur + shadowOffsetY;
- minX = Math.min(minX, shadowLeft);
- maxX = Math.max(maxX, shadowRight);
- minY = Math.min(minY, shadowTop);
- maxY = Math.max(maxY, shadowBottom);
- }
- return {
- x: minX,
- y: minY,
- minX: minX,
- minY: minY,
- maxX: maxX,
- maxY: maxY,
- width: maxX - minX,
- height: maxY - minY
- };
- };
- /**
- * @protected
- * 清理缓存的 bbox
- */
- AbstractShape.prototype.clearCacheBBox = function () {
- this.set('bbox', null);
- this.set('canvasBBox', null);
- }; // 实现接口
- AbstractShape.prototype.isClipShape = function () {
- return this.get('isClipShape');
- };
- /**
- * @protected
- * 不同的图形自己实现是否在图形内部的逻辑,要判断边和填充区域
- * @param {number} refX 相对于图形的坐标 x
- * @param {number} refY 相对于图形的坐标 Y
- * @return {boolean} 点是否在图形内部
- */
- AbstractShape.prototype.isInShape = function (refX, refY) {
- return false;
- };
- /**
- * 是否仅仅使用 BBox 检测就可以判定拾取到图形
- * 默认是 false,但是有些图形例如 image、marker 等都可直接使用 BBox 的检测而不需要使用图形拾取
- * @return {Boolean} 仅仅使用 BBox 进行拾取
- */
- AbstractShape.prototype.isOnlyHitBox = function () {
- return false;
- }; // 不同的 Shape 各自实现
- AbstractShape.prototype.isHit = function (x, y) {
- var startArrowShape = this.get('startArrowShape');
- var endArrowShape = this.get('endArrowShape');
- var vec = [x, y, 1];
- vec = this.invertFromMatrix(vec);
- var refX = vec[0],
- refY = vec[1];
- var inBBox = this._isInBBox(refX, refY); // 跳过图形的拾取,在某些图形中可以省略一倍的检测成本
- if (this.isOnlyHitBox()) {
- return inBBox;
- } // 被裁减掉的和不在包围盒内的不进行计算
- if (inBBox && !this.isClipped(refX, refY)) {
- // 对图形进行拾取判断
- if (this.isInShape(refX, refY)) {
- return true;
- } // 对起始箭头进行拾取判断
- if (startArrowShape && startArrowShape.isHit(refX, refY)) {
- return true;
- } // 对结束箭头进行拾取判断
- if (endArrowShape && endArrowShape.isHit(refX, refY)) {
- return true;
- }
- }
- return false;
- };
- return AbstractShape;
- }(_element__WEBPACK_IMPORTED_MODULE_1__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (AbstractShape);
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/animate/timeline.js":
- /*!**************************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/animate/timeline.js ***!
- \**************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
- /* harmony import */ var d3_timer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-timer */ "./node_modules/_d3-timer@1.0.10@d3-timer/src/index.js");
- /* harmony import */ var d3_ease__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3-ease */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/index.js");
- /* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! d3-interpolate */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/index.js");
- /* harmony import */ var _util_path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/path */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/path.js");
- /* harmony import */ var _util_color__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/color */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/color.js");
- // 目前整体动画只需要数值和数组的差值计算
- var IDENTITY_MATRIX = [1, 0, 0, 0, 1, 0, 0, 0, 1];
- /**
- * 使用 ratio 进行插值计算来更新属性
- * @param {IElement} shape 元素
- * @param {Animation} animation 动画
- * @param {number} ratio 比例
- * @return {boolean} 动画是否执行完成
- */
- function _update(shape, animation, ratio) {
- var cProps = {}; // 此刻属性
- var fromAttrs = animation.fromAttrs,
- toAttrs = animation.toAttrs;
- if (shape.destroyed) {
- return;
- }
- var interf; // 差值函数
- for (var k in toAttrs) {
- if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__["isEqual"])(fromAttrs[k], toAttrs[k])) {
- if (k === 'path') {
- var toPath = toAttrs[k];
- var fromPath = fromAttrs[k];
- if (toPath.length > fromPath.length) {
- toPath = _util_path__WEBPACK_IMPORTED_MODULE_4__["parsePathString"](toAttrs[k]); // 终点状态
- fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__["parsePathString"](fromAttrs[k]); // 起始状态
- fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__["fillPathByDiff"](fromPath, toPath);
- fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__["formatPath"](fromPath, toPath);
- animation.fromAttrs.path = fromPath;
- animation.toAttrs.path = toPath;
- } else if (!animation.pathFormatted) {
- toPath = _util_path__WEBPACK_IMPORTED_MODULE_4__["parsePathString"](toAttrs[k]);
- fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__["parsePathString"](fromAttrs[k]);
- fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__["formatPath"](fromPath, toPath);
- animation.fromAttrs.path = fromPath;
- animation.toAttrs.path = toPath;
- animation.pathFormatted = true;
- }
- cProps[k] = [];
- for (var i = 0; i < toPath.length; i++) {
- var toPathPoint = toPath[i];
- var fromPathPoint = fromPath[i];
- var cPathPoint = [];
- for (var j = 0; j < toPathPoint.length; j++) {
- if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__["isNumber"])(toPathPoint[j]) && fromPathPoint && Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__["isNumber"])(fromPathPoint[j])) {
- interf = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_3__["interpolate"])(fromPathPoint[j], toPathPoint[j]);
- cPathPoint.push(interf(ratio));
- } else {
- cPathPoint.push(toPathPoint[j]);
- }
- }
- cProps[k].push(cPathPoint);
- }
- } else if (k === 'matrix') {
- /*
- 对矩阵进行插值时,需要保证矩阵不为空,为空则使用单位矩阵
- TODO: 二维和三维场景下单位矩阵不同,之后 WebGL 版需要做进一步处理
- */
- var matrixFn = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_3__["interpolateArray"])(fromAttrs[k] || IDENTITY_MATRIX, toAttrs[k] || IDENTITY_MATRIX);
- var currentMatrix = matrixFn(ratio);
- cProps[k] = currentMatrix;
- } else if (Object(_util_color__WEBPACK_IMPORTED_MODULE_5__["isColorProp"])(k) && Object(_util_color__WEBPACK_IMPORTED_MODULE_5__["isGradientColor"])(toAttrs[k])) {
- cProps[k] = toAttrs[k];
- } else if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__["isFunction"])(toAttrs[k])) {
- // 非函数类型的值才能做插值
- interf = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_3__["interpolate"])(fromAttrs[k], toAttrs[k]);
- cProps[k] = interf(ratio);
- }
- }
- }
- shape.attr(cProps);
- }
- /**
- * 根据自定义帧动画函数 onFrame 来更新属性
- * @param {IElement} shape 元素
- * @param {Animation} animation 动画
- * @param {number} elapsed 动画执行时间(毫秒)
- * @return {boolean} 动画是否执行完成
- */
- function update(shape, animation, elapsed) {
- var startTime = animation.startTime,
- delay = animation.delay; // 如果还没有开始执行或暂停,先不更新
- if (elapsed < startTime + delay || animation._paused) {
- return false;
- }
- var ratio;
- var duration = animation.duration;
- var easing = animation.easing; // 已执行时间
- elapsed = elapsed - startTime - animation.delay;
- if (animation.repeat) {
- // 如果动画重复执行,则 elapsed > duration,计算 ratio 时需取模
- ratio = elapsed % duration / duration;
- ratio = d3_ease__WEBPACK_IMPORTED_MODULE_2__[easing](ratio);
- } else {
- ratio = elapsed / duration;
- if (ratio < 1) {
- // 动画未执行完
- ratio = d3_ease__WEBPACK_IMPORTED_MODULE_2__[easing](ratio);
- } else {
- // 动画已执行完
- if (animation.onFrame) {
- shape.attr(animation.onFrame(1));
- } else {
- shape.attr(animation.toAttrs);
- }
- return true;
- }
- }
- if (animation.onFrame) {
- var attrs = animation.onFrame(ratio);
- shape.attr(attrs);
- } else {
- _update(shape, animation, ratio);
- }
- return false;
- }
- var Timeline =
- /** @class */
- function () {
- /**
- * 时间轴构造函数,依赖于画布
- * @param {}
- */
- function Timeline(canvas) {
- /**
- * 执行动画的元素列表
- * @type {IElement[]}
- */
- this.animators = [];
- /**
- * 当前时间
- * @type {number}
- */
- this.current = 0;
- /**
- * 定时器
- * @type {d3Timer.Timer}
- */
- this.timer = null;
- this.canvas = canvas;
- }
- /**
- * 初始化定时器
- */
- Timeline.prototype.initTimer = function () {
- console.log('here... initTimer')
- var _this = this;
- var isFinished = false;
- var shape;
- var animations;
- var animation;
- this.timer = d3_timer__WEBPACK_IMPORTED_MODULE_1__["timer"](function (elapsed) {
- _this.current = elapsed;
- console.log('here... run timer')
- if (_this.animators.length > 0) {
- for (var i = _this.animators.length - 1; i >= 0; i--) {
- shape = _this.animators[i];
- if (shape.destroyed) {
- // 如果已经被销毁,直接移出队列
- _this.removeAnimator(i);
- continue;
- }
- if (!shape.isAnimatePaused()) {
- animations = shape.get('animations');
- for (var j = animations.length - 1; j >= 0; j--) {
- animation = animations[j];
- isFinished = update(shape, animation, elapsed);
- if (isFinished) {
- animations.splice(j, 1);
- isFinished = false;
- if (animation.callback) {
- animation.callback();
- }
- }
- }
- }
- if (animations.length === 0) {
- _this.removeAnimator(i);
- }
- }
- var autoDraw = _this.canvas.get('autoDraw'); // 非自动渲染模式下,手动调用 canvas.draw() 重新渲染
- if (!autoDraw) {
- _this.canvas.draw();
- }
- }
- });
- };
- /**
- * 增加动画元素
- */
- Timeline.prototype.addAnimator = function (shape) {
- this.animators.push(shape);
- };
- /**
- * 移除动画元素
- */
- Timeline.prototype.removeAnimator = function (index) {
- this.animators.splice(index, 1);
- };
- /**
- * 是否有动画在执行
- */
- Timeline.prototype.isAnimating = function () {
- return !!this.animators.length;
- };
- /**
- * 停止定时器
- */
- Timeline.prototype.stop = function () {
- if (this.timer) {
- this.timer.stop();
- }
- };
- /**
- * 停止时间轴上所有元素的动画,并置空动画元素列表
- * @param {boolean} toEnd 是否到动画的最终状态,用来透传给动画元素的 stopAnimate 方法
- */
- Timeline.prototype.stopAllAnimations = function (toEnd) {
- if (toEnd === void 0) {
- toEnd = true;
- }
- this.animators.forEach(function (animator) {
- animator.stopAnimate(toEnd);
- });
- this.animators = [];
- this.canvas.draw();
- };
- /**
- * 获取当前时间
- */
- Timeline.prototype.getTime = function () {
- return this.current;
- };
- return Timeline;
- }();
- /* harmony default export */ __webpack_exports__["default"] = (Timeline);
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/event/event-contoller.js":
- /*!*******************************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/event/event-contoller.js ***!
- \*******************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _graph_event__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./graph-event */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/event/graph-event.js");
- /* harmony import */ var _util_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/util.js");
- /**
- * @fileoverview 事件处理器
- * @author dxq613@gmail.com
- */
- var CLICK_OFFSET = 40;
- var LEFT_BTN_CODE = 0;
- var DELEGATION_SPLIT = ':';
- var EVENTS = ['mousedown', 'mouseup', 'dblclick', 'mouseout', 'mouseover', 'mousemove', 'mouseleave', 'mouseenter', 'touchstart', 'touchmove', 'touchend', 'dragenter', 'dragover', 'dragleave', 'drop', 'contextmenu', 'mousewheel']; // 是否有委托事件监听
- function hasDelegation(events, type) {
- for (var key in events) {
- if (events.hasOwnProperty(key) && key.indexOf(DELEGATION_SPLIT + type) >= 0) {
- return true;
- }
- }
- return false;
- } // 触发目标事件,目标只能是 shape 或 canvas
- function emitTargetEvent(target, type, eventObj) {
- eventObj.name = type;
- eventObj.target = target;
- eventObj.currentTarget = target;
- eventObj.delegateTarget = target;
- target.emit(type, eventObj);
- } // 事件冒泡, enter 和 leave 需要对 fromShape 和 toShape 进行判同
- function bubbleEvent(container, type, eventObj) {
- if (eventObj.bubbles) {
- var relativeShape = void 0;
- var isOverEvent = false;
- if (type === 'mouseenter') {
- relativeShape = eventObj.fromShape;
- isOverEvent = true;
- } else if (type === 'mouseleave') {
- isOverEvent = true;
- relativeShape = eventObj.toShape;
- } // canvas 上的 mouseenter, mouseleave 事件,仅当进入或者移出 canvas 时触发
- if (container.isCanvas() && isOverEvent) {
- return;
- } // 如果相关图形同当前图形在同一个容器内,不触发事件
- if (relativeShape && Object(_util_util__WEBPACK_IMPORTED_MODULE_1__["isParent"])(container, relativeShape)) {
- // 阻止继续向上冒泡
- eventObj.bubbles = false;
- return;
- } // 事件名称可能在委托过程中被修改,因此事件冒泡时需要重新设置事件名称
- eventObj.name = type;
- eventObj.currentTarget = container;
- eventObj.delegateTarget = container;
- container.emit(type, eventObj);
- }
- }
- var EventController =
- /** @class */
- function () {
- function EventController(cfg) {
- var _this = this; // 正在被拖拽的图形
- this.draggingShape = null;
- this.dragging = false; // 当前鼠标/touch所在位置的图形
- this.currentShape = null;
- this.mousedownShape = null;
- this.mousedownPoint = null; // 统一处理所有的回调
- this._eventCallback = function (ev) {
- var type = ev.type;
- _this._triggerEvent(type, ev);
- }; // 在 document 处理拖拽到画布外的事件,处理从图形上移除画布未被捕捉的问题
- this._onDocumentMove = function (ev) {
- var canvas = _this.canvas;
- var el = canvas.get('el');
- if (el !== ev.target) {
- // 不在 canvas 上移动
- if (_this.dragging || _this.currentShape) {
- var pointInfo = _this._getPointInfo(ev); // 还在拖拽过程中
- if (_this.dragging) {
- _this._emitEvent('drag', ev, pointInfo, _this.draggingShape);
- } // 说明从某个图形直接移动到了画布外面,
- // 修复了 mouseleave 的 bug 后不再出现这种情况
- // if (this.currentShape) {
- // this._emitEvent('mouseleave', ev, pointInfo, this.currentShape, this.currentShape, null);
- // this.currentShape = null;
- // }
- }
- }
- }; // 在 document 上处理拖拽到外面,释放鼠标时触发 dragend
- this._onDocumentMouseUp = function (ev) {
- var canvas = _this.canvas;
- var el = canvas.get('el');
- if (el !== ev.target) {
- // 不在 canvas 上移动
- if (_this.dragging) {
- var pointInfo = _this._getPointInfo(ev);
- if (_this.draggingShape) {
- // 如果存在拖拽的图形,则也触发 drop 事件
- _this._emitEvent('drop', ev, pointInfo, null);
- }
- _this._emitEvent('dragend', ev, pointInfo, _this.draggingShape);
- _this._afterDrag(_this.draggingShape, pointInfo, ev);
- }
- }
- };
- this.canvas = cfg.canvas;
- }
- EventController.prototype.init = function () {
- this._bindEvents();
- }; // 注册事件
- EventController.prototype._bindEvents = function () {
- var _this = this;
- var el = this.canvas.get('el');
- Object(_util_util__WEBPACK_IMPORTED_MODULE_1__["each"])(EVENTS, function (eventName) {
- el.addEventListener(eventName, _this._eventCallback);
- });
- if (document) {
- // 处理移动到外面没有触发 shape mouse leave 的事件
- // 处理拖拽到外部的问题
- document.addEventListener('mousemove', this._onDocumentMove); // 处理拖拽过程中在外部释放鼠标的问题
- document.addEventListener('mouseup', this._onDocumentMouseUp);
- }
- }; // 清理事件
- EventController.prototype._clearEvents = function () {
- var _this = this;
- var el = this.canvas.get('el');
- Object(_util_util__WEBPACK_IMPORTED_MODULE_1__["each"])(EVENTS, function (eventName) {
- el.removeEventListener(eventName, _this._eventCallback);
- });
- if (document) {
- document.removeEventListener('mousemove', this._onDocumentMove);
- document.removeEventListener('mouseup', this._onDocumentMouseUp);
- }
- };
- EventController.prototype._getEventObj = function (type, event, point, target, fromShape, toShape) {
- var eventObj = new _graph_event__WEBPACK_IMPORTED_MODULE_0__["default"](type, event);
- eventObj.fromShape = fromShape;
- eventObj.toShape = toShape;
- eventObj.x = point.x;
- eventObj.y = point.y;
- eventObj.clientX = point.clientX;
- eventObj.clientY = point.clientY;
- eventObj.propagationPath.push(target); // 事件的x,y应该是基于画布左上角的,与canvas的matrix无关
- return eventObj;
- }; // 根据点获取图形,提取成独立方法,便于后续优化
- EventController.prototype._getShape = function (point, ev) {
- return this.canvas.getShape(point.x, point.y, ev);
- }; // 获取事件的当前点的信息
- EventController.prototype._getPointInfo = function (ev) {
- var canvas = this.canvas;
- var clientPoint = canvas.getClientByEvent(ev);
- var point = canvas.getPointByEvent(ev);
- return {
- x: point.x,
- y: point.y,
- clientX: clientPoint.x,
- clientY: clientPoint.y
- };
- }; // 触发事件
- EventController.prototype._triggerEvent = function (type, ev) {
- var pointInfo = this._getPointInfo(ev); // 每次都获取图形有一定成本,后期可以考虑进行缓存策略
- var shape = this._getShape(pointInfo, ev);
- var method = this["_on" + type];
- var leaveCanvas = false;
- if (method) {
- method.call(this, pointInfo, shape, ev);
- } else {
- var preShape = this.currentShape; // 如果进入、移出画布时存在图形,则要分别触发事件
- if (type === 'mouseenter' || type === 'dragenter' || type === 'mouseover') {
- this._emitEvent(type, ev, pointInfo, null, null, shape); // 先进入画布
- if (shape) {
- this._emitEvent(type, ev, pointInfo, shape, null, shape); // 再触发图形的事件
- }
- if (type === 'mouseenter' && this.draggingShape) {
- // 如果正在拖拽图形, 则触发 dragleave
- this._emitEvent('dragenter', ev, pointInfo, null);
- }
- } else if (type === 'mouseleave' || type === 'dragleave' || type === 'mouseout') {
- leaveCanvas = true;
- if (preShape) {
- this._emitEvent(type, ev, pointInfo, preShape, preShape, null); // 先触发图形的事件
- }
- this._emitEvent(type, ev, pointInfo, null, preShape, null); // 再触发离开画布事件
- if (type === 'mouseleave' && this.draggingShape) {
- this._emitEvent('dragleave', ev, pointInfo, null);
- }
- } else {
- this._emitEvent(type, ev, pointInfo, shape, null, null); // 一般事件中不需要考虑 from, to
- }
- }
- if (!leaveCanvas) {
- this.currentShape = shape;
- } // 当鼠标从画布移动到 shape 或者从 preShape 移动到 shape 时,应用 shape 上的鼠标样式
- if (shape && !shape.get('destroyed')) {
- var canvas = this.canvas;
- var el = canvas.get('el');
- el.style.cursor = shape.attr('cursor') || canvas.get('cursor');
- }
- }; // 记录下点击的位置、图形,便于拖拽事件、click 事件的判定
- EventController.prototype._onmousedown = function (pointInfo, shape, event) {
- // 只有鼠标左键的 mousedown 事件才会设置 mousedownShape 等属性,避免鼠标右键的 mousedown 事件引起其他事件发生
- if (event.button === LEFT_BTN_CODE) {
- this.mousedownShape = shape;
- this.mousedownPoint = pointInfo;
- this.mousedownTimeStamp = event.timeStamp;
- }
- this._emitEvent('mousedown', event, pointInfo, shape, null, null); // mousedown 不考虑fromShape, toShape
- }; // mouseleave 和 mouseenter 都是成对存在的
- // mouseenter 和 mouseover 同时触发
- EventController.prototype._emitMouseoverEvents = function (event, pointInfo, fromShape, toShape) {
- var el = this.canvas.get('el');
- if (fromShape !== toShape) {
- if (fromShape) {
- this._emitEvent('mouseout', event, pointInfo, fromShape, fromShape, toShape);
- this._emitEvent('mouseleave', event, pointInfo, fromShape, fromShape, toShape); // 当鼠标从 fromShape 移动到画布上时,重置鼠标样式
- if (!toShape || toShape.get('destroyed')) {
- el.style.cursor = this.canvas.get('cursor');
- }
- }
- if (toShape) {
- this._emitEvent('mouseover', event, pointInfo, toShape, fromShape, toShape);
- this._emitEvent('mouseenter', event, pointInfo, toShape, fromShape, toShape);
- }
- }
- }; // dragover 不等同于 mouseover,而等同于 mousemove
- EventController.prototype._emitDragoverEvents = function (event, pointInfo, fromShape, toShape, isCanvasEmit) {
- if (toShape) {
- if (toShape !== fromShape) {
- if (fromShape) {
- this._emitEvent('dragleave', event, pointInfo, fromShape, fromShape, toShape);
- }
- this._emitEvent('dragenter', event, pointInfo, toShape, fromShape, toShape);
- }
- if (!isCanvasEmit) {
- this._emitEvent('dragover', event, pointInfo, toShape);
- }
- } else if (fromShape) {
- // TODO: 此处判断有问题,当 drag 图形时,也会触发一次 dragleave 事件,因为此时 toShape 为 null,这不是所期望的
- // 经过空白区域
- this._emitEvent('dragleave', event, pointInfo, fromShape, fromShape, toShape);
- }
- if (isCanvasEmit) {
- this._emitEvent('dragover', event, pointInfo, toShape);
- }
- }; // drag 完成后,需要做一些清理工作
- EventController.prototype._afterDrag = function (draggingShape, pointInfo, event) {
- if (draggingShape) {
- draggingShape.set('capture', true); // 恢复可以拾取
- this.draggingShape = null;
- }
- this.dragging = false; // drag 完成后,有可能 draggingShape 已经移动到了当前位置,所以不能直接取当前图形
- var shape = this._getShape(pointInfo, event); // 拖拽完成后,进行 enter,leave 的判定
- if (shape !== draggingShape) {
- this._emitMouseoverEvents(event, pointInfo, draggingShape, shape);
- }
- this.currentShape = shape; // 更新当前 shape,如果不处理当前图形的 mouseleave 事件可能会出问题
- }; // 按键抬起时,会终止拖拽、触发点击
- EventController.prototype._onmouseup = function (pointInfo, shape, event) {
- // eevent.button === 0 表示鼠标左键事件,此处加上判断主要是为了避免右键鼠标会触发 mouseup 和 click 事件
- // ref: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
- if (event.button === LEFT_BTN_CODE) {
- var draggingShape = this.draggingShape;
- if (this.dragging) {
- // 存在可以拖拽的图形,同时拖拽到其他图形上时触发 drag 事件
- if (draggingShape) {
- this._emitEvent('drop', event, pointInfo, shape);
- }
- this._emitEvent('dragend', event, pointInfo, draggingShape);
- this._afterDrag(draggingShape, pointInfo, event);
- } else {
- this._emitEvent('mouseup', event, pointInfo, shape); // 先触发 mouseup 再触发 click
- if (shape === this.mousedownShape) {
- this._emitEvent('click', event, pointInfo, shape);
- }
- this.mousedownShape = null;
- this.mousedownPoint = null;
- }
- }
- }; // 当触发浏览器的 dragover 事件时,不会再触发 mousemove ,所以这时候的 dragenter, dragleave 事件需要重新处理
- EventController.prototype._ondragover = function (pointInfo, shape, event) {
- event.preventDefault(); // 如果不对 dragover 进行 preventDefault,则不会在 canvas 上触发 drop 事件
- var preShape = this.currentShape;
- this._emitDragoverEvents(event, pointInfo, preShape, shape, true);
- }; // 大量的图形事件,都通过 mousemove 模拟
- EventController.prototype._onmousemove = function (pointInfo, shape, event) {
- var canvas = this.canvas;
- var preShape = this.currentShape;
- var draggingShape = this.draggingShape; // 正在拖拽时
- if (this.dragging) {
- // 正在拖拽中
- if (draggingShape) {
- // 如果拖拽了 shape 会触发 dragenter, dragleave, dragover 和 drag 事件
- this._emitDragoverEvents(event, pointInfo, preShape, shape, false);
- } // 如果存在 draggingShape 则会在 draggingShape 上触发 drag 事件,冒泡到 canvas 上
- // 否则在 canvas 上触发 drag 事件
- this._emitEvent('drag', event, pointInfo, draggingShape);
- } else {
- var mousedownPoint = this.mousedownPoint;
- if (mousedownPoint) {
- // 当鼠标点击下去,同时移动时,进行 drag 判定
- var mousedownShape = this.mousedownShape;
- var now = event.timeStamp;
- var timeWindow = now - this.mousedownTimeStamp;
- var dx = mousedownPoint.clientX - pointInfo.clientX;
- var dy = mousedownPoint.clientY - pointInfo.clientY;
- var dist = dx * dx + dy * dy;
- if (timeWindow > 120 || dist > CLICK_OFFSET) {
- if (mousedownShape && mousedownShape.get('draggable')) {
- // 设置了 draggable 的 shape 才能触发 drag 相关的事件
- draggingShape = this.mousedownShape; // 拖动鼠标点下时的 shape
- draggingShape.set('capture', false); // 禁止继续拾取,否则无法进行 dragover,dragenter,dragleave,drop的判定
- this.draggingShape = draggingShape;
- this.dragging = true;
- this._emitEvent('dragstart', event, pointInfo, draggingShape); // 清理按下鼠标时缓存的值
- this.mousedownShape = null;
- this.mousedownPoint = null;
- } else if (!mousedownShape && canvas.get('draggable')) {
- // 设置了 draggable 的 canvas 才能触发 drag 相关的事件
- this.dragging = true;
- this._emitEvent('dragstart', event, pointInfo, null); // 清理按下鼠标时缓存的值
- this.mousedownShape = null;
- this.mousedownPoint = null;
- } else {
- this._emitMouseoverEvents(event, pointInfo, preShape, shape);
- this._emitEvent('mousemove', event, pointInfo, shape);
- }
- } else {
- this._emitMouseoverEvents(event, pointInfo, preShape, shape);
- this._emitEvent('mousemove', event, pointInfo, shape);
- }
- } else {
- // 没有按键按下时,则直接触发 mouse over 相关的各种事件
- this._emitMouseoverEvents(event, pointInfo, preShape, shape); // 始终触发移动
- this._emitEvent('mousemove', event, pointInfo, shape);
- }
- }
- }; // 触发事件
- EventController.prototype._emitEvent = function (type, event, pointInfo, shape, fromShape, toShape) {
- var eventObj = this._getEventObj(type, event, pointInfo, shape, fromShape, toShape); // 存在 shape 触发,则进行冒泡处理
- if (shape) {
- eventObj.shape = shape; // 触发 shape 上的事件
- emitTargetEvent(shape, type, eventObj);
- var parent_1 = shape.getParent(); // 执行冒泡
- while (parent_1) {
- // 委托事件要先触发
- parent_1.emitDelegation(type, eventObj); // 事件冒泡停止,不能妨碍委托事件
- if (!eventObj.propagationStopped) {
- bubbleEvent(parent_1, type, eventObj);
- }
- eventObj.propagationPath.push(parent_1);
- parent_1 = parent_1.getParent();
- }
- } else {
- // 如果没有 shape 直接在 canvas 上触发
- var canvas = this.canvas; // 直接触发 canvas 上的事件
- emitTargetEvent(canvas, type, eventObj);
- }
- };
- EventController.prototype.destroy = function () {
- // 清理事件
- this._clearEvents(); // 清理缓存的对象
- this.canvas = null;
- this.currentShape = null;
- this.draggingShape = null;
- this.mousedownPoint = null;
- this.mousedownShape = null;
- this.mousedownTimeStamp = null;
- };
- return EventController;
- }();
- /* harmony default export */ __webpack_exports__["default"] = (EventController);
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/event/graph-event.js":
- /*!***************************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/event/graph-event.js ***!
- \***************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var GraphEvent =
- /** @class */
- function () {
- function GraphEvent(type, event) {
- /**
- * 是否允许冒泡
- * @type {boolean}
- */
- this.bubbles = true;
- /**
- * 触发对象
- * @type {object}
- */
- this.target = null;
- /**
- * 监听对象
- * @type {object}
- */
- this.currentTarget = null;
- /**
- * 委托对象
- * @type {object}
- */
- this.delegateTarget = null;
- /**
- * 委托事件监听对象的代理对象,即 ev.delegateObject = ev.currentTarget.get('delegateObject')
- * @type {object}
- */
- this.delegateObject = null;
- /**
- * 是否阻止了原生事件
- * @type {boolean}
- */
- this.defaultPrevented = false;
- /**
- * 是否阻止传播(向上冒泡)
- * @type {boolean}
- */
- this.propagationStopped = false;
- /**
- * 触发事件的图形
- * @type {IShape}
- */
- this.shape = null;
- /**
- * 开始触发事件的图形
- * @type {IShape}
- */
- this.fromShape = null;
- /**
- * 事件结束时的触发图形
- * @type {IShape}
- */
- this.toShape = null; // 触发事件的路径
- this.propagationPath = [];
- this.type = type;
- this.name = type;
- this.originalEvent = event;
- this.timeStamp = event.timeStamp;
- }
- /**
- * 阻止浏览器默认的行为
- */
- GraphEvent.prototype.preventDefault = function () {
- this.defaultPrevented = true;
- if (this.originalEvent.preventDefault) {
- this.originalEvent.preventDefault();
- }
- };
- /**
- * 阻止冒泡
- */
- GraphEvent.prototype.stopPropagation = function () {
- this.propagationStopped = true;
- };
- GraphEvent.prototype.toString = function () {
- var type = this.type;
- return "[Event (type=" + type + ")]";
- };
- GraphEvent.prototype.save = function () {};
- GraphEvent.prototype.restore = function () {};
- return GraphEvent;
- }();
- /* harmony default export */ __webpack_exports__["default"] = (GraphEvent);
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/index.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/index.js ***!
- \***************************************************************************/
- /*! exports provided: version, Event, Base, AbstractCanvas, AbstractGroup, AbstractShape, PathUtil */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; });
- /* harmony import */ var _util_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/path */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/path.js");
- /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "PathUtil", function() { return _util_path__WEBPACK_IMPORTED_MODULE_0__; });
- /* harmony import */ var _event_graph_event__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./event/graph-event */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/event/graph-event.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Event", function() { return _event_graph_event__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _abstract_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./abstract/base */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/base.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Base", function() { return _abstract_base__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _abstract_canvas__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./abstract/canvas */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/canvas.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AbstractCanvas", function() { return _abstract_canvas__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _abstract_group__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./abstract/group */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/group.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AbstractGroup", function() { return _abstract_group__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _abstract_shape__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./abstract/shape */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/shape.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AbstractShape", function() { return _abstract_shape__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /**
- * @fileoverview G 的基础接口定义和所有的抽象类
- * @author dxq613@gmail.com
- */
- var pkg = __webpack_require__(/*! ../package.json */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/package.json");
- var version = pkg.version;
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/color.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/color.js ***!
- \********************************************************************************/
- /*! exports provided: isColorProp, isGradientColor */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isColorProp", function() { return isColorProp; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isGradientColor", function() { return isGradientColor; });
- var isColorProp = function (prop) {
- return ['fill', 'stroke', 'fillStyle', 'strokeStyle'].includes(prop);
- };
- var isGradientColor = function (val) {
- return /^[r,R,L,l]{1}[\s]*\(/.test(val);
- };
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/matrix.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/matrix.js ***!
- \*********************************************************************************/
- /*! exports provided: multiplyMatrix, multiplyVec2, invert */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyMatrix", function() { return multiplyMatrix; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyVec2", function() { return multiplyVec2; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
- /**
- * @fileoverview 矩阵运算,本来是要引入 gl-matrix, 但是考虑到 g-mobile 对大小有限制,同时 g-webgl 使用的 matrix 不一致
- * 所以,这里仅实现 2D 几个运算,上层自己引入 gl-matrix
- * @author dxq613@gmail.com
- */
- /**
- * 3阶矩阵相乘
- * @param {number[]} a 矩阵1
- * @param {number[]} b 矩阵2
- */
- function multiplyMatrix(a, b) {
- var out = [];
- var a00 = a[0];
- var a01 = a[1];
- var a02 = a[2];
- var a10 = a[3];
- var a11 = a[4];
- var a12 = a[5];
- var a20 = a[6];
- var a21 = a[7];
- var a22 = a[8];
- var b00 = b[0];
- var b01 = b[1];
- var b02 = b[2];
- var b10 = b[3];
- var b11 = b[4];
- var b12 = b[5];
- var b20 = b[6];
- var b21 = b[7];
- var b22 = b[8];
- out[0] = b00 * a00 + b01 * a10 + b02 * a20;
- out[1] = b00 * a01 + b01 * a11 + b02 * a21;
- out[2] = b00 * a02 + b01 * a12 + b02 * a22;
- out[3] = b10 * a00 + b11 * a10 + b12 * a20;
- out[4] = b10 * a01 + b11 * a11 + b12 * a21;
- out[5] = b10 * a02 + b11 * a12 + b12 * a22;
- out[6] = b20 * a00 + b21 * a10 + b22 * a20;
- out[7] = b20 * a01 + b21 * a11 + b22 * a21;
- out[8] = b20 * a02 + b21 * a12 + b22 * a22;
- return out;
- }
- /**
- * 3阶矩阵同2阶向量相乘
- * @param {number[]} m 矩阵
- * @param {number[]} v 二阶向量
- */
- function multiplyVec2(m, v) {
- var out = [];
- var x = v[0];
- var y = v[1];
- out[0] = m[0] * x + m[3] * y + m[6];
- out[1] = m[1] * x + m[4] * y + m[7];
- return out;
- }
- /**
- * 矩阵的逆
- * @param {number[]} a 矩阵
- */
- function invert(a) {
- var out = [];
- var a00 = a[0];
- var a01 = a[1];
- var a02 = a[2];
- var a10 = a[3];
- var a11 = a[4];
- var a12 = a[5];
- var a20 = a[6];
- var a21 = a[7];
- var a22 = a[8];
- var b01 = a22 * a11 - a12 * a21;
- var b11 = -a22 * a10 + a12 * a20;
- var b21 = a21 * a10 - a11 * a20; // Calculate the determinant
- var det = a00 * b01 + a01 * b11 + a02 * b21;
- if (!det) {
- return null;
- }
- det = 1.0 / det;
- out[0] = b01 * det;
- out[1] = (-a22 * a01 + a02 * a21) * det;
- out[2] = (a12 * a01 - a02 * a11) * det;
- out[3] = b11 * det;
- out[4] = (a22 * a00 - a02 * a20) * det;
- out[5] = (-a12 * a00 + a02 * a10) * det;
- out[6] = b21 * det;
- out[7] = (-a21 * a00 + a01 * a20) * det;
- out[8] = (a11 * a00 - a01 * a10) * det;
- return out;
- }
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/path.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/path.js ***!
- \*******************************************************************************/
- /*! exports provided: catmullRomToBezier, fillPath, fillPathByDiff, formatPath, intersection, parsePathArray, parsePathString, pathToAbsolute, pathToCurve, rectPath */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "catmullRomToBezier", function() { return catmullRomToBezier; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fillPath", function() { return fillPath; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fillPathByDiff", function() { return fillPathByDiff; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatPath", function() { return formatPath; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return intersection; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parsePathArray", function() { return parsePathArray; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parsePathString", function() { return parsePathString; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pathToAbsolute", function() { return pathToAbsolute; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pathToCurve", function() { return pathToCurve; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rectPath", function() { return rectPath; });
- /* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
- var SPACES = '\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029';
- var PATH_COMMAND = new RegExp("([a-z])[" + SPACES + ",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[" + SPACES + "]*,?[" + SPACES + "]*)+)", 'ig');
- var PATH_VALUES = new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[" + SPACES + "]*,?[" + SPACES + "]*", 'ig'); // Parse given path string into an array of arrays of path segments
- var parsePathString = function (pathString) {
- if (!pathString) {
- return null;
- }
- if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__["isArray"])(pathString)) {
- return pathString;
- }
- var paramCounts = {
- a: 7,
- c: 6,
- o: 2,
- h: 1,
- l: 2,
- m: 2,
- r: 4,
- q: 4,
- s: 4,
- t: 2,
- v: 1,
- u: 3,
- z: 0
- };
- var data = [];
- String(pathString).replace(PATH_COMMAND, function (a, b, c) {
- var params = [];
- var name = b.toLowerCase();
- c.replace(PATH_VALUES, function (a, b) {
- b && params.push(+b);
- });
- if (name === 'm' && params.length > 2) {
- data.push([b].concat(params.splice(0, 2)));
- name = 'l';
- b = b === 'm' ? 'l' : 'L';
- }
- if (name === 'o' && params.length === 1) {
- data.push([b, params[0]]);
- }
- if (name === 'r') {
- data.push([b].concat(params));
- } else {
- while (params.length >= paramCounts[name]) {
- data.push([b].concat(params.splice(0, paramCounts[name])));
- if (!paramCounts[name]) {
- break;
- }
- }
- }
- return pathString;
- });
- return data;
- }; // http://schepers.cc/getting-to-the-point
- var catmullRomToBezier = function (crp, z) {
- var d = []; // @ts-ignore
- for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {
- var p = [{
- x: +crp[i - 2],
- y: +crp[i - 1]
- }, {
- x: +crp[i],
- y: +crp[i + 1]
- }, {
- x: +crp[i + 2],
- y: +crp[i + 3]
- }, {
- x: +crp[i + 4],
- y: +crp[i + 5]
- }];
- if (z) {
- if (!i) {
- p[0] = {
- x: +crp[iLen - 2],
- y: +crp[iLen - 1]
- };
- } else if (iLen - 4 === i) {
- p[3] = {
- x: +crp[0],
- y: +crp[1]
- };
- } else if (iLen - 2 === i) {
- p[2] = {
- x: +crp[0],
- y: +crp[1]
- };
- p[3] = {
- x: +crp[2],
- y: +crp[3]
- };
- }
- } else {
- if (iLen - 4 === i) {
- p[3] = p[2];
- } else if (!i) {
- p[0] = {
- x: +crp[i],
- y: +crp[i + 1]
- };
- }
- }
- d.push(['C', (-p[0].x + 6 * p[1].x + p[2].x) / 6, (-p[0].y + 6 * p[1].y + p[2].y) / 6, (p[1].x + 6 * p[2].x - p[3].x) / 6, (p[1].y + 6 * p[2].y - p[3].y) / 6, p[2].x, p[2].y]);
- }
- return d;
- };
- var ellipsePath = function (x, y, rx, ry, a) {
- var res = [];
- if (a === null && ry === null) {
- ry = rx;
- }
- x = +x;
- y = +y;
- rx = +rx;
- ry = +ry;
- if (a !== null) {
- var rad = Math.PI / 180;
- var x1 = x + rx * Math.cos(-ry * rad);
- var x2 = x + rx * Math.cos(-a * rad);
- var y1 = y + rx * Math.sin(-ry * rad);
- var y2 = y + rx * Math.sin(-a * rad);
- res = [['M', x1, y1], ['A', rx, rx, 0, +(a - ry > 180), 0, x2, y2]];
- } else {
- res = [['M', x, y], ['m', 0, -ry], ['a', rx, ry, 0, 1, 1, 0, 2 * ry], ['a', rx, ry, 0, 1, 1, 0, -2 * ry], ['z']];
- }
- return res;
- };
- var pathToAbsolute = function (pathArray) {
- pathArray = parsePathString(pathArray);
- if (!pathArray || !pathArray.length) {
- return [['M', 0, 0]];
- }
- var res = [];
- var x = 0;
- var y = 0;
- var mx = 0;
- var my = 0;
- var start = 0;
- var pa0;
- var dots;
- if (pathArray[0][0] === 'M') {
- x = +pathArray[0][1];
- y = +pathArray[0][2];
- mx = x;
- my = y;
- start++;
- res[0] = ['M', x, y];
- }
- var crz = pathArray.length === 3 && pathArray[0][0] === 'M' && pathArray[1][0].toUpperCase() === 'R' && pathArray[2][0].toUpperCase() === 'Z';
- for (var r = void 0, pa = void 0, i = start, ii = pathArray.length; i < ii; i++) {
- res.push(r = []);
- pa = pathArray[i];
- pa0 = pa[0];
- if (pa0 !== pa0.toUpperCase()) {
- r[0] = pa0.toUpperCase();
- switch (r[0]) {
- case 'A':
- r[1] = pa[1];
- r[2] = pa[2];
- r[3] = pa[3];
- r[4] = pa[4];
- r[5] = pa[5];
- r[6] = +pa[6] + x;
- r[7] = +pa[7] + y;
- break;
- case 'V':
- r[1] = +pa[1] + y;
- break;
- case 'H':
- r[1] = +pa[1] + x;
- break;
- case 'R':
- dots = [x, y].concat(pa.slice(1));
- for (var j = 2, jj = dots.length; j < jj; j++) {
- dots[j] = +dots[j] + x;
- dots[++j] = +dots[j] + y;
- }
- res.pop();
- res = res.concat(catmullRomToBezier(dots, crz));
- break;
- case 'O':
- res.pop();
- dots = ellipsePath(x, y, pa[1], pa[2]);
- dots.push(dots[0]);
- res = res.concat(dots);
- break;
- case 'U':
- res.pop();
- res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
- r = ['U'].concat(res[res.length - 1].slice(-2));
- break;
- case 'M':
- mx = +pa[1] + x;
- my = +pa[2] + y;
- break;
- // for lint
- default:
- for (var j = 1, jj = pa.length; j < jj; j++) {
- r[j] = +pa[j] + (j % 2 ? x : y);
- }
- }
- } else if (pa0 === 'R') {
- dots = [x, y].concat(pa.slice(1));
- res.pop();
- res = res.concat(catmullRomToBezier(dots, crz));
- r = ['R'].concat(pa.slice(-2));
- } else if (pa0 === 'O') {
- res.pop();
- dots = ellipsePath(x, y, pa[1], pa[2]);
- dots.push(dots[0]);
- res = res.concat(dots);
- } else if (pa0 === 'U') {
- res.pop();
- res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
- r = ['U'].concat(res[res.length - 1].slice(-2));
- } else {
- for (var k = 0, kk = pa.length; k < kk; k++) {
- r[k] = pa[k];
- }
- }
- pa0 = pa0.toUpperCase();
- if (pa0 !== 'O') {
- switch (r[0]) {
- case 'Z':
- x = +mx;
- y = +my;
- break;
- case 'H':
- x = r[1];
- break;
- case 'V':
- y = r[1];
- break;
- case 'M':
- mx = r[r.length - 2];
- my = r[r.length - 1];
- break;
- // for lint
- default:
- x = r[r.length - 2];
- y = r[r.length - 1];
- }
- }
- }
- return res;
- };
- var l2c = function (x1, y1, x2, y2) {
- return [x1, y1, x2, y2, x2, y2];
- };
- var q2c = function (x1, y1, ax, ay, x2, y2) {
- var _13 = 1 / 3;
- var _23 = 2 / 3;
- return [_13 * x1 + _23 * ax, _13 * y1 + _23 * ay, _13 * x2 + _23 * ax, _13 * y2 + _23 * ay, x2, y2];
- };
- var a2c = function (x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
- // for more information of where this math came from visit:
- // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
- if (rx === ry) {
- rx += 1;
- }
- var _120 = Math.PI * 120 / 180;
- var rad = Math.PI / 180 * (+angle || 0);
- var res = [];
- var xy;
- var f1;
- var f2;
- var cx;
- var cy;
- var rotate = function (x, y, rad) {
- var X = x * Math.cos(rad) - y * Math.sin(rad);
- var Y = x * Math.sin(rad) + y * Math.cos(rad);
- return {
- x: X,
- y: Y
- };
- };
- if (!recursive) {
- xy = rotate(x1, y1, -rad);
- x1 = xy.x;
- y1 = xy.y;
- xy = rotate(x2, y2, -rad);
- x2 = xy.x;
- y2 = xy.y;
- if (x1 === x2 && y1 === y2) {
- // 若弧的起始点和终点重叠则错开一点
- x2 += 1;
- y2 += 1;
- } // const cos = Math.cos(Math.PI / 180 * angle);
- // const sin = Math.sin(Math.PI / 180 * angle);
- var x = (x1 - x2) / 2;
- var y = (y1 - y2) / 2;
- var h = x * x / (rx * rx) + y * y / (ry * ry);
- if (h > 1) {
- h = Math.sqrt(h);
- rx = h * rx;
- ry = h * ry;
- }
- var rx2 = rx * rx;
- var ry2 = ry * ry;
- var k = (large_arc_flag === sweep_flag ? -1 : 1) * Math.sqrt(Math.abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x)));
- cx = k * rx * y / ry + (x1 + x2) / 2;
- cy = k * -ry * x / rx + (y1 + y2) / 2; // @ts-ignore
- f1 = Math.asin(((y1 - cy) / ry).toFixed(9)); // @ts-ignore
- f2 = Math.asin(((y2 - cy) / ry).toFixed(9));
- f1 = x1 < cx ? Math.PI - f1 : f1;
- f2 = x2 < cx ? Math.PI - f2 : f2;
- f1 < 0 && (f1 = Math.PI * 2 + f1);
- f2 < 0 && (f2 = Math.PI * 2 + f2);
- if (sweep_flag && f1 > f2) {
- f1 = f1 - Math.PI * 2;
- }
- if (!sweep_flag && f2 > f1) {
- f2 = f2 - Math.PI * 2;
- }
- } else {
- f1 = recursive[0];
- f2 = recursive[1];
- cx = recursive[2];
- cy = recursive[3];
- }
- var df = f2 - f1;
- if (Math.abs(df) > _120) {
- var f2old = f2;
- var x2old = x2;
- var y2old = y2;
- f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
- x2 = cx + rx * Math.cos(f2);
- y2 = cy + ry * Math.sin(f2);
- res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
- }
- df = f2 - f1;
- var c1 = Math.cos(f1);
- var s1 = Math.sin(f1);
- var c2 = Math.cos(f2);
- var s2 = Math.sin(f2);
- var t = Math.tan(df / 4);
- var hx = 4 / 3 * rx * t;
- var hy = 4 / 3 * ry * t;
- var m1 = [x1, y1];
- var m2 = [x1 + hx * s1, y1 - hy * c1];
- var m3 = [x2 + hx * s2, y2 - hy * c2];
- var m4 = [x2, y2];
- m2[0] = 2 * m1[0] - m2[0];
- m2[1] = 2 * m1[1] - m2[1];
- if (recursive) {
- return [m2, m3, m4].concat(res);
- }
- res = [m2, m3, m4].concat(res).join().split(',');
- var newres = [];
- for (var i = 0, ii = res.length; i < ii; i++) {
- newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
- }
- return newres;
- };
- var pathToCurve = function (path, path2) {
- var p = pathToAbsolute(path);
- var p2 = path2 && pathToAbsolute(path2);
- var attrs = {
- x: 0,
- y: 0,
- bx: 0,
- by: 0,
- X: 0,
- Y: 0,
- qx: null,
- qy: null
- };
- var attrs2 = {
- x: 0,
- y: 0,
- bx: 0,
- by: 0,
- X: 0,
- Y: 0,
- qx: null,
- qy: null
- };
- var pcoms1 = []; // path commands of original path p
- var pcoms2 = []; // path commands of original path p2
- var pfirst = ''; // temporary holder for original path command
- var pcom = ''; // holder for previous path command of original path
- var ii;
- var processPath = function (path, d, pcom) {
- var nx;
- var ny;
- if (!path) {
- return ['C', d.x, d.y, d.x, d.y, d.x, d.y];
- }
- !(path[0] in {
- T: 1,
- Q: 1
- }) && (d.qx = d.qy = null);
- switch (path[0]) {
- case 'M':
- d.X = path[1];
- d.Y = path[2];
- break;
- case 'A':
- path = ['C'].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));
- break;
- case 'S':
- if (pcom === 'C' || pcom === 'S') {
- // In "S" case we have to take into account, if the previous command is C/S.
- nx = d.x * 2 - d.bx; // And reflect the previous
- ny = d.y * 2 - d.by; // command's control point relative to the current point.
- } else {
- // or some else or nothing
- nx = d.x;
- ny = d.y;
- }
- path = ['C', nx, ny].concat(path.slice(1));
- break;
- case 'T':
- if (pcom === 'Q' || pcom === 'T') {
- // In "T" case we have to take into account, if the previous command is Q/T.
- d.qx = d.x * 2 - d.qx; // And make a reflection similar
- d.qy = d.y * 2 - d.qy; // to case "S".
- } else {
- // or something else or nothing
- d.qx = d.x;
- d.qy = d.y;
- }
- path = ['C'].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));
- break;
- case 'Q':
- d.qx = path[1];
- d.qy = path[2];
- path = ['C'].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));
- break;
- case 'L':
- path = ['C'].concat(l2c(d.x, d.y, path[1], path[2]));
- break;
- case 'H':
- path = ['C'].concat(l2c(d.x, d.y, path[1], d.y));
- break;
- case 'V':
- path = ['C'].concat(l2c(d.x, d.y, d.x, path[1]));
- break;
- case 'Z':
- path = ['C'].concat(l2c(d.x, d.y, d.X, d.Y));
- break;
- default:
- break;
- }
- return path;
- };
- var fixArc = function (pp, i) {
- if (pp[i].length > 7) {
- pp[i].shift();
- var pi = pp[i];
- while (pi.length) {
- pcoms1[i] = 'A'; // if created multiple C:s, their original seg is saved
- p2 && (pcoms2[i] = 'A'); // the same as above
- pp.splice(i++, 0, ['C'].concat(pi.splice(0, 6)));
- }
- pp.splice(i, 1);
- ii = Math.max(p.length, p2 && p2.length || 0);
- }
- };
- var fixM = function (path1, path2, a1, a2, i) {
- if (path1 && path2 && path1[i][0] === 'M' && path2[i][0] !== 'M') {
- path2.splice(i, 0, ['M', a2.x, a2.y]);
- a1.bx = 0;
- a1.by = 0;
- a1.x = path1[i][1];
- a1.y = path1[i][2];
- ii = Math.max(p.length, p2 && p2.length || 0);
- }
- };
- ii = Math.max(p.length, p2 && p2.length || 0);
- for (var i = 0; i < ii; i++) {
- p[i] && (pfirst = p[i][0]); // save current path command
- if (pfirst !== 'C') {
- // C is not saved yet, because it may be result of conversion
- pcoms1[i] = pfirst; // Save current path command
- i && (pcom = pcoms1[i - 1]); // Get previous path command pcom
- }
- p[i] = processPath(p[i], attrs, pcom); // Previous path command is inputted to processPath
- if (pcoms1[i] !== 'A' && pfirst === 'C') pcoms1[i] = 'C'; // A is the only command
- // which may produce multiple C:s
- // so we have to make sure that C is also C in original path
- fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1
- if (p2) {
- // the same procedures is done to p2
- p2[i] && (pfirst = p2[i][0]);
- if (pfirst !== 'C') {
- pcoms2[i] = pfirst;
- i && (pcom = pcoms2[i - 1]);
- }
- p2[i] = processPath(p2[i], attrs2, pcom);
- if (pcoms2[i] !== 'A' && pfirst === 'C') {
- pcoms2[i] = 'C';
- }
- fixArc(p2, i);
- }
- fixM(p, p2, attrs, attrs2, i);
- fixM(p2, p, attrs2, attrs, i);
- var seg = p[i];
- var seg2 = p2 && p2[i];
- var seglen = seg.length;
- var seg2len = p2 && seg2.length;
- attrs.x = seg[seglen - 2];
- attrs.y = seg[seglen - 1];
- attrs.bx = parseFloat(seg[seglen - 4]) || attrs.x;
- attrs.by = parseFloat(seg[seglen - 3]) || attrs.y;
- attrs2.bx = p2 && (parseFloat(seg2[seg2len - 4]) || attrs2.x);
- attrs2.by = p2 && (parseFloat(seg2[seg2len - 3]) || attrs2.y);
- attrs2.x = p2 && seg2[seg2len - 2];
- attrs2.y = p2 && seg2[seg2len - 1];
- }
- return p2 ? [p, p2] : p;
- };
- var p2s = /,?([a-z]),?/gi;
- var parsePathArray = function (path) {
- return path.join(',').replace(p2s, '$1');
- };
- var base3 = function (t, p1, p2, p3, p4) {
- var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4;
- var t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;
- return t * t2 - 3 * p1 + 3 * p2;
- };
- var bezlen = function (x1, y1, x2, y2, x3, y3, x4, y4, z) {
- if (z === null) {
- z = 1;
- }
- z = z > 1 ? 1 : z < 0 ? 0 : z;
- var z2 = z / 2;
- var n = 12;
- var Tvalues = [-0.1252, 0.1252, -0.3678, 0.3678, -0.5873, 0.5873, -0.7699, 0.7699, -0.9041, 0.9041, -0.9816, 0.9816];
- var Cvalues = [0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, 0.1601, 0.1069, 0.1069, 0.0472, 0.0472];
- var sum = 0;
- for (var i = 0; i < n; i++) {
- var ct = z2 * Tvalues[i] + z2;
- var xbase = base3(ct, x1, x2, x3, x4);
- var ybase = base3(ct, y1, y2, y3, y4);
- var comb = xbase * xbase + ybase * ybase;
- sum += Cvalues[i] * Math.sqrt(comb);
- }
- return z2 * sum;
- };
- var curveDim = function (x0, y0, x1, y1, x2, y2, x3, y3) {
- var tvalues = [];
- var bounds = [[], []];
- var a;
- var b;
- var c;
- var t;
- for (var i = 0; i < 2; ++i) {
- if (i === 0) {
- b = 6 * x0 - 12 * x1 + 6 * x2;
- a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
- c = 3 * x1 - 3 * x0;
- } else {
- b = 6 * y0 - 12 * y1 + 6 * y2;
- a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
- c = 3 * y1 - 3 * y0;
- }
- if (Math.abs(a) < 1e-12) {
- if (Math.abs(b) < 1e-12) {
- continue;
- }
- t = -c / b;
- if (t > 0 && t < 1) {
- tvalues.push(t);
- }
- continue;
- }
- var b2ac = b * b - 4 * c * a;
- var sqrtb2ac = Math.sqrt(b2ac);
- if (b2ac < 0) {
- continue;
- }
- var t1 = (-b + sqrtb2ac) / (2 * a);
- if (t1 > 0 && t1 < 1) {
- tvalues.push(t1);
- }
- var t2 = (-b - sqrtb2ac) / (2 * a);
- if (t2 > 0 && t2 < 1) {
- tvalues.push(t2);
- }
- }
- var j = tvalues.length;
- var jlen = j;
- var mt;
- while (j--) {
- t = tvalues[j];
- mt = 1 - t;
- bounds[0][j] = mt * mt * mt * x0 + 3 * mt * mt * t * x1 + 3 * mt * t * t * x2 + t * t * t * x3;
- bounds[1][j] = mt * mt * mt * y0 + 3 * mt * mt * t * y1 + 3 * mt * t * t * y2 + t * t * t * y3;
- }
- bounds[0][jlen] = x0;
- bounds[1][jlen] = y0;
- bounds[0][jlen + 1] = x3;
- bounds[1][jlen + 1] = y3;
- bounds[0].length = bounds[1].length = jlen + 2;
- return {
- min: {
- x: Math.min.apply(0, bounds[0]),
- y: Math.min.apply(0, bounds[1])
- },
- max: {
- x: Math.max.apply(0, bounds[0]),
- y: Math.max.apply(0, bounds[1])
- }
- };
- };
- var intersect = function (x1, y1, x2, y2, x3, y3, x4, y4) {
- if (Math.max(x1, x2) < Math.min(x3, x4) || Math.min(x1, x2) > Math.max(x3, x4) || Math.max(y1, y2) < Math.min(y3, y4) || Math.min(y1, y2) > Math.max(y3, y4)) {
- return;
- }
- var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4);
- var ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4);
- var denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
- if (!denominator) {
- return;
- }
- var px = nx / denominator;
- var py = ny / denominator;
- var px2 = +px.toFixed(2);
- var py2 = +py.toFixed(2);
- if (px2 < +Math.min(x1, x2).toFixed(2) || px2 > +Math.max(x1, x2).toFixed(2) || px2 < +Math.min(x3, x4).toFixed(2) || px2 > +Math.max(x3, x4).toFixed(2) || py2 < +Math.min(y1, y2).toFixed(2) || py2 > +Math.max(y1, y2).toFixed(2) || py2 < +Math.min(y3, y4).toFixed(2) || py2 > +Math.max(y3, y4).toFixed(2)) {
- return;
- }
- return {
- x: px,
- y: py
- };
- };
- var isPointInsideBBox = function (bbox, x, y) {
- return x >= bbox.x && x <= bbox.x + bbox.width && y >= bbox.y && y <= bbox.y + bbox.height;
- };
- var rectPath = function (x, y, w, h, r) {
- if (r) {
- return [['M', +x + +r, y], ['l', w - r * 2, 0], ['a', r, r, 0, 0, 1, r, r], ['l', 0, h - r * 2], ['a', r, r, 0, 0, 1, -r, r], ['l', r * 2 - w, 0], ['a', r, r, 0, 0, 1, -r, -r], ['l', 0, r * 2 - h], ['a', r, r, 0, 0, 1, r, -r], ['z']];
- }
- var res = [['M', x, y], ['l', w, 0], ['l', 0, h], ['l', -w, 0], ['z']]; // @ts-ignore
- res.parsePathArray = parsePathArray;
- return res;
- };
- var box = function (x, y, width, height) {
- if (x === null) {
- x = y = width = height = 0;
- }
- if (y === null) {
- y = x.y;
- width = x.width;
- height = x.height;
- x = x.x;
- }
- return {
- x: x,
- y: y,
- width: width,
- w: width,
- height: height,
- h: height,
- x2: x + width,
- y2: y + height,
- cx: x + width / 2,
- cy: y + height / 2,
- r1: Math.min(width, height) / 2,
- r2: Math.max(width, height) / 2,
- r0: Math.sqrt(width * width + height * height) / 2,
- path: rectPath(x, y, width, height),
- vb: [x, y, width, height].join(' ')
- };
- };
- var isBBoxIntersect = function (bbox1, bbox2) {
- bbox1 = box(bbox1);
- bbox2 = box(bbox2);
- return isPointInsideBBox(bbox2, bbox1.x, bbox1.y) || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y) || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2) || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2) || isPointInsideBBox(bbox1, bbox2.x, bbox2.y) || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y) || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2) || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2) || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x) && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);
- };
- var bezierBBox = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
- if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__["isArray"])(p1x)) {
- p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];
- }
- var bbox = curveDim.apply(null, p1x);
- return box(bbox.min.x, bbox.min.y, bbox.max.x - bbox.min.x, bbox.max.y - bbox.min.y);
- };
- var findDotsAtSegment = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
- var t1 = 1 - t;
- var t13 = Math.pow(t1, 3);
- var t12 = Math.pow(t1, 2);
- var t2 = t * t;
- var t3 = t2 * t;
- var x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x;
- var y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y;
- var mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x);
- var my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y);
- var nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x);
- var ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y);
- var ax = t1 * p1x + t * c1x;
- var ay = t1 * p1y + t * c1y;
- var cx = t1 * c2x + t * p2x;
- var cy = t1 * c2y + t * p2y;
- var alpha = 90 - Math.atan2(mx - nx, my - ny) * 180 / Math.PI; // (mx > nx || my < ny) && (alpha += 180);
- return {
- x: x,
- y: y,
- m: {
- x: mx,
- y: my
- },
- n: {
- x: nx,
- y: ny
- },
- start: {
- x: ax,
- y: ay
- },
- end: {
- x: cx,
- y: cy
- },
- alpha: alpha
- };
- };
- var interHelper = function (bez1, bez2, justCount) {
- var bbox1 = bezierBBox(bez1);
- var bbox2 = bezierBBox(bez2);
- if (!isBBoxIntersect(bbox1, bbox2)) {
- return justCount ? 0 : [];
- }
- var l1 = bezlen.apply(0, bez1);
- var l2 = bezlen.apply(0, bez2);
- var n1 = ~~(l1 / 8);
- var n2 = ~~(l2 / 8);
- var dots1 = [];
- var dots2 = [];
- var xy = {};
- var res = justCount ? 0 : [];
- for (var i = 0; i < n1 + 1; i++) {
- var d = findDotsAtSegment.apply(0, bez1.concat(i / n1));
- dots1.push({
- x: d.x,
- y: d.y,
- t: i / n1
- });
- }
- for (var i = 0; i < n2 + 1; i++) {
- var d = findDotsAtSegment.apply(0, bez2.concat(i / n2));
- dots2.push({
- x: d.x,
- y: d.y,
- t: i / n2
- });
- }
- for (var i = 0; i < n1; i++) {
- for (var j = 0; j < n2; j++) {
- var di = dots1[i];
- var di1 = dots1[i + 1];
- var dj = dots2[j];
- var dj1 = dots2[j + 1];
- var ci = Math.abs(di1.x - di.x) < 0.001 ? 'y' : 'x';
- var cj = Math.abs(dj1.x - dj.x) < 0.001 ? 'y' : 'x';
- var is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);
- if (is) {
- if (xy[is.x.toFixed(4)] === is.y.toFixed(4)) {
- continue;
- }
- xy[is.x.toFixed(4)] = is.y.toFixed(4);
- var t1 = di.t + Math.abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t);
- var t2 = dj.t + Math.abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);
- if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {
- if (justCount) {
- // @ts-ignore
- res += 1;
- } else {
- // @ts-ignore
- res.push({
- x: is.x,
- y: is.y,
- t1: t1,
- t2: t2
- });
- }
- }
- }
- }
- }
- return res;
- };
- var interPathHelper = function (path1, path2, justCount) {
- path1 = pathToCurve(path1);
- path2 = pathToCurve(path2);
- var x1;
- var y1;
- var x2;
- var y2;
- var x1m;
- var y1m;
- var x2m;
- var y2m;
- var bez1;
- var bez2;
- var res = justCount ? 0 : [];
- for (var i = 0, ii = path1.length; i < ii; i++) {
- var pi = path1[i];
- if (pi[0] === 'M') {
- x1 = x1m = pi[1];
- y1 = y1m = pi[2];
- } else {
- if (pi[0] === 'C') {
- bez1 = [x1, y1].concat(pi.slice(1));
- x1 = bez1[6];
- y1 = bez1[7];
- } else {
- bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];
- x1 = x1m;
- y1 = y1m;
- }
- for (var j = 0, jj = path2.length; j < jj; j++) {
- var pj = path2[j];
- if (pj[0] === 'M') {
- x2 = x2m = pj[1];
- y2 = y2m = pj[2];
- } else {
- if (pj[0] === 'C') {
- bez2 = [x2, y2].concat(pj.slice(1));
- x2 = bez2[6];
- y2 = bez2[7];
- } else {
- bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];
- x2 = x2m;
- y2 = y2m;
- }
- var intr = interHelper(bez1, bez2, justCount);
- if (justCount) {
- // @ts-ignore
- res += intr;
- } else {
- // @ts-ignore
- for (var k = 0, kk = intr.length; k < kk; k++) {
- intr[k].segment1 = i;
- intr[k].segment2 = j;
- intr[k].bez1 = bez1;
- intr[k].bez2 = bez2;
- } // @ts-ignore
- res = res.concat(intr);
- }
- }
- }
- }
- }
- return res;
- };
- var intersection = function (path1, path2) {
- return interPathHelper(path1, path2);
- };
- function decasteljau(points, t) {
- var left = [];
- var right = [];
- function recurse(points, t) {
- if (points.length === 1) {
- left.push(points[0]);
- right.push(points[0]);
- } else {
- var middlePoints = [];
- for (var i = 0; i < points.length - 1; i++) {
- if (i === 0) {
- left.push(points[0]);
- }
- if (i === points.length - 2) {
- right.push(points[i + 1]);
- }
- middlePoints[i] = [(1 - t) * points[i][0] + t * points[i + 1][0], (1 - t) * points[i][1] + t * points[i + 1][1]];
- }
- recurse(middlePoints, t);
- }
- }
- if (points.length) {
- recurse(points, t);
- }
- return {
- left: left,
- right: right.reverse()
- };
- }
- function splitCurve(start, end, count) {
- var points = [[start[1], start[2]]];
- count = count || 2;
- var segments = [];
- if (end[0] === 'A') {
- points.push(end[6]);
- points.push(end[7]);
- } else if (end[0] === 'C') {
- points.push([end[1], end[2]]);
- points.push([end[3], end[4]]);
- points.push([end[5], end[6]]);
- } else if (end[0] === 'S' || end[0] === 'Q') {
- points.push([end[1], end[2]]);
- points.push([end[3], end[4]]);
- } else {
- points.push([end[1], end[2]]);
- }
- var leftSegments = points;
- var t = 1 / count;
- for (var i = 0; i < count - 1; i++) {
- var rt = t / (1 - t * i);
- var split = decasteljau(leftSegments, rt);
- segments.push(split.left);
- leftSegments = split.right;
- }
- segments.push(leftSegments);
- var result = segments.map(function (segment) {
- var cmd = [];
- if (segment.length === 4) {
- cmd.push('C');
- cmd = cmd.concat(segment[2]);
- }
- if (segment.length >= 3) {
- if (segment.length === 3) {
- cmd.push('Q');
- }
- cmd = cmd.concat(segment[1]);
- }
- if (segment.length === 2) {
- cmd.push('L');
- }
- cmd = cmd.concat(segment[segment.length - 1]);
- return cmd;
- });
- return result;
- }
- var splitSegment = function (start, end, count) {
- if (count === 1) {
- return [[].concat(start)];
- }
- var segments = [];
- if (end[0] === 'L' || end[0] === 'C' || end[0] === 'Q') {
- segments = segments.concat(splitCurve(start, end, count));
- } else {
- var temp = [].concat(start);
- if (temp[0] === 'M') {
- temp[0] = 'L';
- }
- for (var i = 0; i <= count - 1; i++) {
- segments.push(temp);
- }
- }
- return segments;
- };
- var fillPath = function (source, target) {
- if (source.length === 1) {
- return source;
- }
- var sourceLen = source.length - 1;
- var targetLen = target.length - 1;
- var ratio = sourceLen / targetLen;
- var segmentsToFill = [];
- if (source.length === 1 && source[0][0] === 'M') {
- for (var i = 0; i < targetLen - sourceLen; i++) {
- source.push(source[0]);
- }
- return source;
- }
- for (var i = 0; i < targetLen; i++) {
- var index = Math.floor(ratio * i);
- segmentsToFill[index] = (segmentsToFill[index] || 0) + 1;
- }
- var filled = segmentsToFill.reduce(function (filled, count, i) {
- if (i === sourceLen) {
- return filled.concat(source[sourceLen]);
- }
- return filled.concat(splitSegment(source[i], source[i + 1], count));
- }, []);
- filled.unshift(source[0]);
- if (target[targetLen] === 'Z' || target[targetLen] === 'z') {
- filled.push('Z');
- }
- return filled;
- };
- var isEqual = function (obj1, obj2) {
- if (obj1.length !== obj2.length) {
- return false;
- }
- var result = true;
- Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__["each"])(obj1, function (item, i) {
- if (item !== obj2[i]) {
- result = false;
- return false;
- }
- });
- return result;
- };
- function getMinDiff(del, add, modify) {
- var type = null;
- var min = modify;
- if (add < min) {
- min = add;
- type = 'add';
- }
- if (del < min) {
- min = del;
- type = 'del';
- }
- return {
- type: type,
- min: min
- };
- }
- /*
- * https://en.wikipedia.org/wiki/Levenshtein_distance
- * 计算两条path的编辑距离
- */
- var levenshteinDistance = function (source, target) {
- var sourceLen = source.length;
- var targetLen = target.length;
- var sourceSegment;
- var targetSegment;
- var temp = 0;
- if (sourceLen === 0 || targetLen === 0) {
- return null;
- }
- var dist = [];
- for (var i = 0; i <= sourceLen; i++) {
- dist[i] = [];
- dist[i][0] = {
- min: i
- };
- }
- for (var j = 0; j <= targetLen; j++) {
- dist[0][j] = {
- min: j
- };
- }
- for (var i = 1; i <= sourceLen; i++) {
- sourceSegment = source[i - 1];
- for (var j = 1; j <= targetLen; j++) {
- targetSegment = target[j - 1];
- if (isEqual(sourceSegment, targetSegment)) {
- temp = 0;
- } else {
- temp = 1;
- }
- var del = dist[i - 1][j].min + 1;
- var add = dist[i][j - 1].min + 1;
- var modify = dist[i - 1][j - 1].min + temp;
- dist[i][j] = getMinDiff(del, add, modify);
- }
- }
- return dist;
- };
- var fillPathByDiff = function (source, target) {
- var diffMatrix = levenshteinDistance(source, target);
- var sourceLen = source.length;
- var targetLen = target.length;
- var changes = [];
- var index = 1;
- var minPos = 1; // 如果source和target不是完全不相等
- if (diffMatrix[sourceLen][targetLen].min !== sourceLen) {
- // 获取从source到target所需改动
- for (var i = 1; i <= sourceLen; i++) {
- var min = diffMatrix[i][i].min;
- minPos = i;
- for (var j = index; j <= targetLen; j++) {
- if (diffMatrix[i][j].min < min) {
- min = diffMatrix[i][j].min;
- minPos = j;
- }
- }
- index = minPos;
- if (diffMatrix[i][index].type) {
- changes.push({
- index: i - 1,
- type: diffMatrix[i][index].type
- });
- }
- } // 对source进行增删path
- for (var i = changes.length - 1; i >= 0; i--) {
- index = changes[i].index;
- if (changes[i].type === 'add') {
- source.splice(index, 0, [].concat(source[index]));
- } else {
- source.splice(index, 1);
- }
- }
- } // source尾部补齐
- sourceLen = source.length;
- var diff = targetLen - sourceLen;
- if (sourceLen < targetLen) {
- for (var i = 0; i < diff; i++) {
- if (source[sourceLen - 1][0] === 'z' || source[sourceLen - 1][0] === 'Z') {
- source.splice(sourceLen - 2, 0, source[sourceLen - 2]);
- } else {
- source.push(source[sourceLen - 1]);
- }
- sourceLen += 1;
- }
- }
- return source;
- }; // 将两个点均分成count个点
- function _splitPoints(points, former, count) {
- var result = [].concat(points);
- var index;
- var t = 1 / (count + 1);
- var formerEnd = _getSegmentPoints(former)[0];
- for (var i = 1; i <= count; i++) {
- t *= i;
- index = Math.floor(points.length * t);
- if (index === 0) {
- result.unshift([formerEnd[0] * t + points[index][0] * (1 - t), formerEnd[1] * t + points[index][1] * (1 - t)]);
- } else {
- result.splice(index, 0, [formerEnd[0] * t + points[index][0] * (1 - t), formerEnd[1] * t + points[index][1] * (1 - t)]);
- }
- }
- return result;
- }
- /*
- * 抽取pathSegment中的关键点
- * M,L,A,Q,H,V一个端点
- * Q, S抽取一个端点,一个控制点
- * C抽取一个端点,两个控制点
- */
- function _getSegmentPoints(segment) {
- var points = [];
- switch (segment[0]) {
- case 'M':
- points.push([segment[1], segment[2]]);
- break;
- case 'L':
- points.push([segment[1], segment[2]]);
- break;
- case 'A':
- points.push([segment[6], segment[7]]);
- break;
- case 'Q':
- points.push([segment[3], segment[4]]);
- points.push([segment[1], segment[2]]);
- break;
- case 'T':
- points.push([segment[1], segment[2]]);
- break;
- case 'C':
- points.push([segment[5], segment[6]]);
- points.push([segment[1], segment[2]]);
- points.push([segment[3], segment[4]]);
- break;
- case 'S':
- points.push([segment[3], segment[4]]);
- points.push([segment[1], segment[2]]);
- break;
- case 'H':
- points.push([segment[1], segment[1]]);
- break;
- case 'V':
- points.push([segment[1], segment[1]]);
- break;
- default:
- }
- return points;
- }
- var formatPath = function (fromPath, toPath) {
- if (fromPath.length <= 1) {
- return fromPath;
- }
- var points;
- for (var i = 0; i < toPath.length; i++) {
- if (fromPath[i][0] !== toPath[i][0]) {
- // 获取fromPath的pathSegment的端点,根据toPath的指令对其改造
- points = _getSegmentPoints(fromPath[i]);
- switch (toPath[i][0]) {
- case 'M':
- fromPath[i] = ['M'].concat(points[0]);
- break;
- case 'L':
- fromPath[i] = ['L'].concat(points[0]);
- break;
- case 'A':
- fromPath[i] = [].concat(toPath[i]);
- fromPath[i][6] = points[0][0];
- fromPath[i][7] = points[0][1];
- break;
- case 'Q':
- if (points.length < 2) {
- if (i > 0) {
- points = _splitPoints(points, fromPath[i - 1], 1);
- } else {
- fromPath[i] = toPath[i];
- break;
- }
- }
- fromPath[i] = ['Q'].concat(points.reduce(function (arr, i) {
- return arr.concat(i);
- }, []));
- break;
- case 'T':
- fromPath[i] = ['T'].concat(points[0]);
- break;
- case 'C':
- if (points.length < 3) {
- if (i > 0) {
- points = _splitPoints(points, fromPath[i - 1], 2);
- } else {
- fromPath[i] = toPath[i];
- break;
- }
- }
- fromPath[i] = ['C'].concat(points.reduce(function (arr, i) {
- return arr.concat(i);
- }, []));
- break;
- case 'S':
- if (points.length < 2) {
- if (i > 0) {
- points = _splitPoints(points, fromPath[i - 1], 1);
- } else {
- fromPath[i] = toPath[i];
- break;
- }
- }
- fromPath[i] = ['S'].concat(points.reduce(function (arr, i) {
- return arr.concat(i);
- }, []));
- break;
- default:
- fromPath[i] = toPath[i];
- }
- }
- }
- return fromPath;
- };
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/util.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/util.js ***!
- \*******************************************************************************/
- /*! exports provided: removeFromArray, isBrowser, isNil, isFunction, isString, isObject, isArray, mix, each, upperFirst, isParent, isAllowCapture */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFromArray", function() { return removeFromArray; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowser", function() { return isBrowser; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isParent", function() { return isParent; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAllowCapture", function() { return isAllowCapture; });
- /* harmony import */ var _antv_util_lib_is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util/lib/is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
- /* harmony import */ var _antv_util_lib_is_nil__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_is_nil__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "isNil", function() { return _antv_util_lib_is_nil__WEBPACK_IMPORTED_MODULE_0___default.a; });
- /* harmony import */ var _antv_util_lib_is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util/lib/is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
- /* harmony import */ var _antv_util_lib_is_function__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_is_function__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return _antv_util_lib_is_function__WEBPACK_IMPORTED_MODULE_1___default.a; });
- /* harmony import */ var _antv_util_lib_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util/lib/is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js");
- /* harmony import */ var _antv_util_lib_is_string__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_is_string__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _antv_util_lib_is_string__WEBPACK_IMPORTED_MODULE_2___default.a; });
- /* harmony import */ var _antv_util_lib_is_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/util/lib/is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js");
- /* harmony import */ var _antv_util_lib_is_object__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_is_object__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return _antv_util_lib_is_object__WEBPACK_IMPORTED_MODULE_3___default.a; });
- /* harmony import */ var _antv_util_lib_is_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/util/lib/is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
- /* harmony import */ var _antv_util_lib_is_array__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_is_array__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return _antv_util_lib_is_array__WEBPACK_IMPORTED_MODULE_4___default.a; });
- /* harmony import */ var _antv_util_lib_mix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @antv/util/lib/mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mix.js");
- /* harmony import */ var _antv_util_lib_mix__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_mix__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "mix", function() { return _antv_util_lib_mix__WEBPACK_IMPORTED_MODULE_5___default.a; });
- /* harmony import */ var _antv_util_lib_each__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @antv/util/lib/each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
- /* harmony import */ var _antv_util_lib_each__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_each__WEBPACK_IMPORTED_MODULE_6__);
- /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "each", function() { return _antv_util_lib_each__WEBPACK_IMPORTED_MODULE_6___default.a; });
- /* harmony import */ var _antv_util_lib_upper_first__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @antv/util/lib/upper-first */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/upper-first.js");
- /* harmony import */ var _antv_util_lib_upper_first__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_upper_first__WEBPACK_IMPORTED_MODULE_7__);
- /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "upperFirst", function() { return _antv_util_lib_upper_first__WEBPACK_IMPORTED_MODULE_7___default.a; });
- function removeFromArray(arr, obj) {
- var index = arr.indexOf(obj);
- if (index !== -1) {
- arr.splice(index, 1);
- }
- }
- var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
- // 是否元素的父容器
- function isParent(container, shape) {
- // 所有 shape 都是 canvas 的子元素
- if (container.isCanvas()) {
- return true;
- }
- var parent = shape.getParent();
- var isParent = false;
- while (parent) {
- if (parent === container) {
- isParent = true;
- break;
- }
- parent = parent.getParent();
- }
- return isParent;
- }
- function isAllowCapture(element) {
- // @ts-ignore
- return element.cfg.visible && element.cfg.capture;
- }
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/circle.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/circle.js ***!
- \*********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- function default_1(shape) {
- var _a = shape.attr(),
- x = _a.x,
- y = _a.y,
- r = _a.r;
- return {
- x: x - r,
- y: y - r,
- width: r * 2,
- height: r * 2
- };
- }
- exports.default = default_1;
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/ellipse.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/ellipse.js ***!
- \**********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- function default_1(shape) {
- var attrs = shape.attr();
- var x = attrs.x,
- y = attrs.y,
- rx = attrs.rx,
- ry = attrs.ry;
- return {
- x: x - rx,
- y: y - ry,
- width: rx * 2,
- height: ry * 2
- };
- }
- exports.default = default_1;
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/index.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/index.js ***!
- \********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var register_1 = __webpack_require__(/*! ./register */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/register.js");
- exports.getBBoxMethod = register_1.getMethod;
- var rect_1 = __webpack_require__(/*! ./rect */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/rect.js");
- var circle_1 = __webpack_require__(/*! ./circle */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/circle.js");
- var polyline_1 = __webpack_require__(/*! ./polyline */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/polyline.js");
- var polygon_1 = __webpack_require__(/*! ./polygon */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/polygon.js");
- var text_1 = __webpack_require__(/*! ./text */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/text.js");
- var path_1 = __webpack_require__(/*! ./path */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/path.js");
- var line_1 = __webpack_require__(/*! ./line */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/line.js");
- var ellipse_1 = __webpack_require__(/*! ./ellipse */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/ellipse.js");
- register_1.register('rect', rect_1.default);
- register_1.register('image', rect_1.default); // image 使用 rect 的包围盒计算
- register_1.register('circle', circle_1.default);
- register_1.register('marker', circle_1.default); // marker 使用 circle 的计算方案
- register_1.register('polyline', polyline_1.default);
- register_1.register('polygon', polygon_1.default);
- register_1.register('text', text_1.default);
- register_1.register('path', path_1.default);
- register_1.register('line', line_1.default);
- register_1.register('ellipse', ellipse_1.default);
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/line.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/line.js ***!
- \*******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/util.js");
- function default_1(shape) {
- var attrs = shape.attr();
- var x1 = attrs.x1,
- y1 = attrs.y1,
- x2 = attrs.x2,
- y2 = attrs.y2;
- var minX = Math.min(x1, x2);
- var maxX = Math.max(x1, x2);
- var minY = Math.min(y1, y2);
- var maxY = Math.max(y1, y2);
- var bbox = {
- minX: minX,
- maxX: maxX,
- minY: minY,
- maxY: maxY
- };
- bbox = util_1.mergeArrowBBox(shape, bbox);
- return {
- x: bbox.minX,
- y: bbox.minY,
- width: bbox.maxX - bbox.minX,
- height: bbox.maxY - bbox.minY
- };
- }
- exports.default = default_1;
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/path.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/path.js ***!
- \*******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var quadratic_1 = __webpack_require__(/*! @antv/g-math/lib/quadratic */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/quadratic.js");
- var cubic_1 = __webpack_require__(/*! @antv/g-math/lib/cubic */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/cubic.js");
- var arc_1 = __webpack_require__(/*! @antv/g-math/lib/arc */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/arc.js");
- var path_2_segments_1 = __webpack_require__(/*! @antv/path-util/lib/path-2-segments */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-segments.js");
- var is_number_equal_1 = __webpack_require__(/*! @antv/util/lib/is-number-equal */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number-equal.js");
- var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/util.js");
- function getPathBox(segments, lineWidth) {
- var xArr = [];
- var yArr = [];
- var segmentsWithAngle = [];
- for (var i = 0; i < segments.length; i++) {
- var segment = segments[i];
- var currentPoint = segment.currentPoint,
- params = segment.params,
- prePoint = segment.prePoint;
- var box = void 0;
- switch (segment.command) {
- case 'Q':
- box = quadratic_1.default.box(prePoint[0], prePoint[1], params[1], params[2], params[3], params[4]);
- break;
- case 'C':
- box = cubic_1.default.box(prePoint[0], prePoint[1], params[1], params[2], params[3], params[4], params[5], params[6]);
- break;
- case 'A':
- var arcParams = segment.arcParams;
- box = arc_1.default.box(arcParams.cx, arcParams.cy, arcParams.rx, arcParams.ry, arcParams.xRotation, arcParams.startAngle, arcParams.endAngle);
- break;
- default:
- xArr.push(currentPoint[0]);
- yArr.push(currentPoint[1]);
- break;
- }
- if (box) {
- segment.box = box;
- xArr.push(box.x, box.x + box.width);
- yArr.push(box.y, box.y + box.height);
- }
- if (lineWidth && (segment.command === 'L' || segment.command === 'M') && segment.prePoint && segment.nextPoint) {
- segmentsWithAngle.push(segment);
- }
- } // bbox calculation should ignore NaN for path attribute
- // ref: https://github.com/antvis/g/issues/210
- xArr = xArr.filter(function (item) {
- return !Number.isNaN(item);
- });
- yArr = yArr.filter(function (item) {
- return !Number.isNaN(item);
- });
- var minX = Math.min.apply(null, xArr);
- var minY = Math.min.apply(null, yArr);
- var maxX = Math.max.apply(null, xArr);
- var maxY = Math.max.apply(null, yArr);
- if (segmentsWithAngle.length === 0) {
- return {
- x: minX,
- y: minY,
- width: maxX - minX,
- height: maxY - minY
- };
- }
- for (var i = 0; i < segmentsWithAngle.length; i++) {
- var segment = segmentsWithAngle[i];
- var currentPoint = segment.currentPoint;
- var extra = void 0;
- if (currentPoint[0] === minX) {
- extra = getExtraFromSegmentWithAngle(segment, lineWidth);
- minX = minX - extra.xExtra;
- } else if (currentPoint[0] === maxX) {
- extra = getExtraFromSegmentWithAngle(segment, lineWidth);
- maxX = maxX + extra.xExtra;
- }
- if (currentPoint[1] === minY) {
- extra = getExtraFromSegmentWithAngle(segment, lineWidth);
- minY = minY - extra.yExtra;
- } else if (currentPoint[1] === maxY) {
- extra = getExtraFromSegmentWithAngle(segment, lineWidth);
- maxY = maxY + extra.yExtra;
- }
- }
- return {
- x: minX,
- y: minY,
- width: maxX - minX,
- height: maxY - minY
- };
- }
- function getExtraFromSegmentWithAngle(segment, lineWidth) {
- var prePoint = segment.prePoint,
- currentPoint = segment.currentPoint,
- nextPoint = segment.nextPoint;
- var currentAndPre = Math.pow(currentPoint[0] - prePoint[0], 2) + Math.pow(currentPoint[1] - prePoint[1], 2);
- var currentAndNext = Math.pow(currentPoint[0] - nextPoint[0], 2) + Math.pow(currentPoint[1] - nextPoint[1], 2);
- var preAndNext = Math.pow(prePoint[0] - nextPoint[0], 2) + Math.pow(prePoint[1] - nextPoint[1], 2); // 以 currentPoint 为顶点的夹角
- var currentAngle = Math.acos((currentAndPre + currentAndNext - preAndNext) / (2 * Math.sqrt(currentAndPre) * Math.sqrt(currentAndNext))); // 夹角为空、 0 或 PI 时,不需要计算夹角处的额外宽度
- // 注意: 由于计算精度问题,夹角为 0 的情况计算出来的角度可能是一个很小的值,还需要判断其与 0 是否近似相等
- if (!currentAngle || Math.sin(currentAngle) === 0 || is_number_equal_1.default(currentAngle, 0)) {
- return {
- xExtra: 0,
- yExtra: 0
- };
- }
- var xAngle = Math.abs(Math.atan2(nextPoint[1] - currentPoint[1], nextPoint[0] - currentPoint[0]));
- var yAngle = Math.abs(Math.atan2(nextPoint[0] - currentPoint[0], nextPoint[1] - currentPoint[1])); // 将夹角转为锐角
- xAngle = xAngle > Math.PI / 2 ? Math.PI - xAngle : xAngle;
- yAngle = yAngle > Math.PI / 2 ? Math.PI - yAngle : yAngle; // 这里不考虑在水平和垂直方向的投影,直接使用最大差值
- // 由于上层统一加减了二分之一线宽,这里需要进行弥补
- var extra = {
- // 水平方向投影
- xExtra: Math.cos(currentAngle / 2 - xAngle) * (lineWidth / 2 * (1 / Math.sin(currentAngle / 2))) - lineWidth / 2 || 0,
- // 垂直方向投影
- yExtra: Math.cos(yAngle - currentAngle / 2) * (lineWidth / 2 * (1 / Math.sin(currentAngle / 2))) - lineWidth / 2 || 0
- };
- return extra;
- }
- function default_1(shape) {
- var attrs = shape.attr();
- var path = attrs.path,
- stroke = attrs.stroke;
- var lineWidth = stroke ? attrs.lineWidth : 0; // 只有有 stroke 时,lineWidth 才生效
- var segments = shape.get('segments') || path_2_segments_1.default(path);
- var _a = getPathBox(segments, lineWidth),
- x = _a.x,
- y = _a.y,
- width = _a.width,
- height = _a.height;
- var bbox = {
- minX: x,
- minY: y,
- maxX: x + width,
- maxY: y + height
- };
- bbox = util_1.mergeArrowBBox(shape, bbox);
- return {
- x: bbox.minX,
- y: bbox.minY,
- width: bbox.maxX - bbox.minX,
- height: bbox.maxY - bbox.minY
- };
- }
- exports.default = default_1;
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/polygon.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/polygon.js ***!
- \**********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var util_1 = __webpack_require__(/*! @antv/g-math/lib/util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
- function default_1(shape) {
- var attrs = shape.attr();
- var points = attrs.points;
- var xArr = [];
- var yArr = [];
- for (var i = 0; i < points.length; i++) {
- var point = points[i];
- xArr.push(point[0]);
- yArr.push(point[1]);
- }
- return util_1.getBBoxByArray(xArr, yArr);
- }
- exports.default = default_1;
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/polyline.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/polyline.js ***!
- \***********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var util_1 = __webpack_require__(/*! @antv/g-math/lib/util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
- var util_2 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/util.js");
- function default_1(shape) {
- var attrs = shape.attr();
- var points = attrs.points;
- var xArr = [];
- var yArr = [];
- for (var i = 0; i < points.length; i++) {
- var point = points[i];
- xArr.push(point[0]);
- yArr.push(point[1]);
- }
- var _a = util_1.getBBoxByArray(xArr, yArr),
- x = _a.x,
- y = _a.y,
- width = _a.width,
- height = _a.height;
- var bbox = {
- minX: x,
- minY: y,
- maxX: x + width,
- maxY: y + height
- };
- bbox = util_2.mergeArrowBBox(shape, bbox);
- return {
- x: bbox.minX,
- y: bbox.minY,
- width: bbox.maxX - bbox.minX,
- height: bbox.maxY - bbox.minY
- };
- }
- exports.default = default_1;
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/rect.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/rect.js ***!
- \*******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- function default_1(shape) {
- var attrs = shape.attr();
- var x = attrs.x,
- y = attrs.y,
- width = attrs.width,
- height = attrs.height;
- return {
- x: x,
- y: y,
- width: width,
- height: height
- };
- }
- exports.default = default_1;
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/register.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/register.js ***!
- \***********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var cache = new Map();
- /**
- * 注册计算包围盒的算法
- * @param type 方法名
- * @param method 方法
- */
- function register(type, method) {
- cache.set(type, method);
- }
- exports.register = register;
- /**
- * 获取计算包围盒的算法
- * @param type 方法名
- */
- function getMethod(type) {
- return cache.get(type);
- }
- exports.getMethod = getMethod;
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/text.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/text.js ***!
- \*******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var text_1 = __webpack_require__(/*! ../util/text */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/text.js");
- function default_1(shape) {
- var attrs = shape.attr();
- var x = attrs.x,
- y = attrs.y,
- text = attrs.text,
- fontSize = attrs.fontSize,
- lineHeight = attrs.lineHeight;
- var font = attrs.font;
- if (!font) {
- // 如果未组装 font
- font = text_1.assembleFont(attrs);
- }
- var width = text_1.getTextWidth(text, font);
- var bbox;
- if (!width) {
- // 如果width不存在,四点共其实点
- bbox = {
- x: x,
- y: y,
- width: 0,
- height: 0
- };
- } else {
- var textAlign = attrs.textAlign,
- textBaseline = attrs.textBaseline;
- var height = text_1.getTextHeight(text, fontSize, lineHeight); // attrs.height
- // 默认左右对齐:left, 默认上下对齐 bottom
- var point = {
- x: x,
- y: y - height
- };
- if (textAlign) {
- if (textAlign === 'end' || textAlign === 'right') {
- point.x -= width;
- } else if (textAlign === 'center') {
- point.x -= width / 2;
- }
- }
- if (textBaseline) {
- if (textBaseline === 'top') {
- point.y += height;
- } else if (textBaseline === 'middle') {
- point.y += height / 2;
- }
- }
- bbox = {
- x: point.x,
- y: point.y,
- width: width,
- height: height
- };
- }
- return bbox;
- }
- exports.default = default_1;
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/util.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/util.js ***!
- \*******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- }); // 合并包围盒
- function mergeBBox(bbox1, bbox2) {
- if (!bbox1 || !bbox2) {
- return bbox1 || bbox2;
- }
- return {
- minX: Math.min(bbox1.minX, bbox2.minX),
- minY: Math.min(bbox1.minY, bbox2.minY),
- maxX: Math.max(bbox1.maxX, bbox2.maxX),
- maxY: Math.max(bbox1.maxY, bbox2.maxY)
- };
- }
- exports.mergeBBox = mergeBBox; // 合并箭头的包围盒
- function mergeArrowBBox(shape, bbox) {
- var startArrowShape = shape.get('startArrowShape');
- var endArrowShape = shape.get('endArrowShape');
- var startArrowBBox = null;
- var endArrowBBox = null;
- if (startArrowShape) {
- startArrowBBox = startArrowShape.getCanvasBBox();
- bbox = mergeBBox(bbox, startArrowBBox);
- }
- if (endArrowShape) {
- endArrowBBox = endArrowShape.getCanvasBBox();
- bbox = mergeBBox(bbox, endArrowBBox);
- }
- return bbox;
- }
- exports.mergeArrowBBox = mergeArrowBBox;
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/interfaces.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/interfaces.js ***!
- \********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/types.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/types.js ***!
- \***************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/matrix.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/matrix.js ***!
- \*********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview 矩阵运算,本来是要引入 gl-matrix, 但是考虑到 g-mobile 对大小有限制,同时 g-webgl 使用的 matrix 不一致
- * 所以,这里仅实现 2D 几个运算,上层自己引入 gl-matrix
- * @author dxq613@gmail.com
- */
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- /**
- * 3阶矩阵相乘
- * @param {number[]} a 矩阵1
- * @param {number[]} b 矩阵2
- */
- function multiplyMatrix(a, b) {
- var out = [];
- var a00 = a[0];
- var a01 = a[1];
- var a02 = a[2];
- var a10 = a[3];
- var a11 = a[4];
- var a12 = a[5];
- var a20 = a[6];
- var a21 = a[7];
- var a22 = a[8];
- var b00 = b[0];
- var b01 = b[1];
- var b02 = b[2];
- var b10 = b[3];
- var b11 = b[4];
- var b12 = b[5];
- var b20 = b[6];
- var b21 = b[7];
- var b22 = b[8];
- out[0] = b00 * a00 + b01 * a10 + b02 * a20;
- out[1] = b00 * a01 + b01 * a11 + b02 * a21;
- out[2] = b00 * a02 + b01 * a12 + b02 * a22;
- out[3] = b10 * a00 + b11 * a10 + b12 * a20;
- out[4] = b10 * a01 + b11 * a11 + b12 * a21;
- out[5] = b10 * a02 + b11 * a12 + b12 * a22;
- out[6] = b20 * a00 + b21 * a10 + b22 * a20;
- out[7] = b20 * a01 + b21 * a11 + b22 * a21;
- out[8] = b20 * a02 + b21 * a12 + b22 * a22;
- return out;
- }
- exports.multiplyMatrix = multiplyMatrix;
- /**
- * 3阶矩阵同2阶向量相乘
- * @param {number[]} m 矩阵
- * @param {number[]} v 二阶向量
- */
- function multiplyVec2(m, v) {
- var out = [];
- var x = v[0];
- var y = v[1];
- out[0] = m[0] * x + m[3] * y + m[6];
- out[1] = m[1] * x + m[4] * y + m[7];
- return out;
- }
- exports.multiplyVec2 = multiplyVec2;
- /**
- * 矩阵的逆
- * @param {number[]} a 矩阵
- */
- function invert(a) {
- var out = [];
- var a00 = a[0];
- var a01 = a[1];
- var a02 = a[2];
- var a10 = a[3];
- var a11 = a[4];
- var a12 = a[5];
- var a20 = a[6];
- var a21 = a[7];
- var a22 = a[8];
- var b01 = a22 * a11 - a12 * a21;
- var b11 = -a22 * a10 + a12 * a20;
- var b21 = a21 * a10 - a11 * a20; // Calculate the determinant
- var det = a00 * b01 + a01 * b11 + a02 * b21;
- if (!det) {
- return null;
- }
- det = 1.0 / det;
- out[0] = b01 * det;
- out[1] = (-a22 * a01 + a02 * a21) * det;
- out[2] = (a12 * a01 - a02 * a11) * det;
- out[3] = b11 * det;
- out[4] = (a22 * a00 - a02 * a20) * det;
- out[5] = (-a12 * a00 + a02 * a10) * det;
- out[6] = b21 * det;
- out[7] = (-a21 * a00 + a01 * a20) * det;
- out[8] = (a11 * a00 - a01 * a10) * det;
- return out;
- }
- exports.invert = invert;
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/offscreen.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/offscreen.js ***!
- \************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- }); // 全局设置一个唯一离屏的 ctx,用于计算 isPointInPath
- var offScreenCtx = null;
- function getOffScreenContext() {
- if (!offScreenCtx) {
- var canvas = document.createElement('canvas');
- canvas.width = 1;
- canvas.height = 1;
- offScreenCtx = canvas.getContext('2d');
- }
- return offScreenCtx;
- }
- exports.getOffScreenContext = getOffScreenContext;
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/text.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/text.js ***!
- \*******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/util.js");
- var offscreen_1 = __webpack_require__(/*! ./offscreen */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/offscreen.js");
- /**
- * 获取文本的高度
- * @param text 文本
- * @param fontSize 字体大小
- * @param lineHeight 行高,可以为空
- */
- function getTextHeight(text, fontSize, lineHeight) {
- var lineCount = 1;
- if (util_1.isString(text)) {
- lineCount = text.split('\n').length;
- }
- if (lineCount > 1) {
- var spaceingY = getLineSpaceing(fontSize, lineHeight);
- return fontSize * lineCount + spaceingY * (lineCount - 1);
- }
- return fontSize;
- }
- exports.getTextHeight = getTextHeight;
- /**
- * 获取行间距如果文本多行,需要获取文本间距
- * @param fontSize 字体大小
- * @param lineHeight 行高
- */
- function getLineSpaceing(fontSize, lineHeight) {
- return lineHeight ? lineHeight - fontSize : fontSize * 0.14;
- }
- exports.getLineSpaceing = getLineSpaceing;
- /**
- * 字体宽度
- * @param text 文本
- * @param font 字体
- */
- function getTextWidth(text, font) {
- var context = offscreen_1.getOffScreenContext(); // 获取离屏的 ctx 进行计算
- var width = 0; // null 或者 undefined 时,宽度为 0
- if (util_1.isNil(text) || text === '') {
- return width;
- }
- context.save();
- context.font = font;
- if (util_1.isString(text) && text.includes('\n')) {
- var textArr = text.split('\n');
- util_1.each(textArr, function (subText) {
- var measureWidth = context.measureText(subText).width;
- if (width < measureWidth) {
- width = measureWidth;
- }
- });
- } else {
- width = context.measureText(text).width;
- }
- context.restore();
- return width;
- }
- exports.getTextWidth = getTextWidth;
- function assembleFont(attrs) {
- var fontSize = attrs.fontSize,
- fontFamily = attrs.fontFamily,
- fontWeight = attrs.fontWeight,
- fontStyle = attrs.fontStyle,
- fontVariant = attrs.fontVariant;
- return [fontStyle, fontVariant, fontWeight, fontSize + "px", fontFamily].join(' ').trim();
- }
- exports.assembleFont = assembleFont;
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/util.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/util.js ***!
- \*******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- function removeFromArray(arr, obj) {
- var index = arr.indexOf(obj);
- if (index !== -1) {
- arr.splice(index, 1);
- }
- }
- exports.removeFromArray = removeFromArray;
- exports.isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
- var is_nil_1 = __webpack_require__(/*! @antv/util/lib/is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
- exports.isNil = is_nil_1.default;
- var is_function_1 = __webpack_require__(/*! @antv/util/lib/is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
- exports.isFunction = is_function_1.default;
- var is_string_1 = __webpack_require__(/*! @antv/util/lib/is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js");
- exports.isString = is_string_1.default;
- var is_object_1 = __webpack_require__(/*! @antv/util/lib/is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js");
- exports.isObject = is_object_1.default;
- var is_array_1 = __webpack_require__(/*! @antv/util/lib/is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
- exports.isArray = is_array_1.default;
- var mix_1 = __webpack_require__(/*! @antv/util/lib/mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mix.js");
- exports.mix = mix_1.default;
- var each_1 = __webpack_require__(/*! @antv/util/lib/each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
- exports.each = each_1.default;
- var upper_first_1 = __webpack_require__(/*! @antv/util/lib/upper-first */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/upper-first.js");
- exports.upperFirst = upper_first_1.default; // 是否元素的父容器
- function isParent(container, shape) {
- // 所有 shape 都是 canvas 的子元素
- if (container.isCanvas()) {
- return true;
- }
- var parent = shape.getParent();
- var isParent = false;
- while (parent) {
- if (parent === container) {
- isParent = true;
- break;
- }
- parent = parent.getParent();
- }
- return isParent;
- }
- exports.isParent = isParent;
- function isAllowCapture(element) {
- // @ts-ignore
- return element.cfg.visible && element.cfg.capture;
- }
- exports.isAllowCapture = isAllowCapture;
- /***/ }),
- /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/package.json":
- /*!***************************************************************************!*\
- !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/package.json ***!
- \***************************************************************************/
- /*! exports provided: name, version, description, main, module, types, files, scripts, repository, keywords, publishConfig, author, license, bugs, devDependencies, homepage, dependencies, __npminstall_done, gitHead, _from, _resolved, default */
- /***/ (function(module) {
- module.exports = JSON.parse("{\"name\":\"@antv/g-base\",\"version\":\"0.5.0-beta.1\",\"description\":\"A common util collection for antv projects\",\"main\":\"lib/index.js\",\"module\":\"esm/index.js\",\"types\":\"lib/index.d.ts\",\"files\":[\"package.json\",\"esm\",\"lib\",\"LICENSE\",\"README.md\"],\"scripts\":{\"build\":\"npm run clean && run-p build:*\",\"build:esm\":\"tsc -p tsconfig.json --target ES5 --module ESNext --outDir esm\",\"build:cjs\":\"tsc -p tsconfig.json --target ES5 --module commonjs --outDir lib\",\"clean\":\"rm -rf esm lib\",\"watch:cjs\":\"tsc-watch -p tsconfig.json --target ES5 --module commonjs --outDir lib --compiler typescript/bin/tsc\",\"coverage\":\"npm run coverage-generator && npm run coverage-viewer\",\"coverage-generator\":\"torch --coverage --compile --source-pattern src/*.js,src/**/*.js --opts tests/mocha.opts\",\"coverage-viewer\":\"torch-coverage\",\"test\":\"torch --renderer --compile --opts tests/mocha.opts\",\"test-live\":\"torch --compile --interactive tests/unit\",\"tsc\":\"tsc --noEmit\",\"typecheck\":\"tsc --noEmit\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/antvis/util.git\"},\"keywords\":[\"util\",\"antv\",\"g\"],\"publishConfig\":{\"access\":\"public\"},\"author\":\"https://github.com/orgs/antvis/people\",\"license\":\"ISC\",\"bugs\":{\"url\":\"https://github.com/antvis/util/issues\"},\"devDependencies\":{\"@antv/torch\":\"^1.0.0\",\"gl-matrix\":\"^3.0.0\",\"less\":\"^3.9.0\",\"npm-run-all\":\"^4.1.5\",\"tsc-watch\":\"^4.0.0\"},\"homepage\":\"https://github.com/antvis/util#readme\",\"dependencies\":{\"@antv/event-emitter\":\"^0.1.1\",\"@antv/g-math\":\"^0.1.3\",\"@antv/matrix-util\":\"^3.1.0-beta.1\",\"@antv/path-util\":\"~2.0.5\",\"@antv/util\":\"~2.0.0\",\"@types/d3-timer\":\"^1.0.9\",\"d3-ease\":\"^1.0.5\",\"d3-interpolate\":\"^1.3.2\",\"d3-timer\":\"^1.0.9\",\"detect-browser\":\"^5.1.0\"},\"__npminstall_done\":\"Fri May 29 2020 19:03:41 GMT+0800 (GMT+08:00)\",\"gitHead\":\"f1dd2cc436ea123939f400a9a9d88f1ebce46be9\",\"_from\":\"@antv/g-base@0.5.0-beta.1\",\"_resolved\":\"https://registry.npm.taobao.org/@antv/g-base/download/@antv/g-base-0.5.0-beta.1.tgz\"}");
- /***/ }),
- /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/arc.js":
- /*!******************************************************************!*\
- !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/arc.js ***!
- \******************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
- var ellipse_1 = __webpack_require__(/*! ./ellipse */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/ellipse.js"); // 偏导数 x
- function derivativeXAt(cx, cy, rx, ry, xRotation, startAngle, endAngle, angle) {
- return -1 * rx * Math.cos(xRotation) * Math.sin(angle) - ry * Math.sin(xRotation) * Math.cos(angle);
- } // 偏导数 y
- function derivativeYAt(cx, cy, rx, ry, xRotation, startAngle, endAngle, angle) {
- return -1 * rx * Math.sin(xRotation) * Math.sin(angle) + ry * Math.cos(xRotation) * Math.cos(angle);
- } // x 的极值
- function xExtrema(rx, ry, xRotation) {
- return Math.atan(-ry / rx * Math.tan(xRotation));
- } // y 的极值
- function yExtrema(rx, ry, xRotation) {
- return Math.atan(ry / (rx * Math.tan(xRotation)));
- } // 根据角度求 x 坐标
- function xAt(cx, cy, rx, ry, xRotation, angle) {
- return rx * Math.cos(xRotation) * Math.cos(angle) - ry * Math.sin(xRotation) * Math.sin(angle) + cx;
- } // 根据角度求 y 坐标
- function yAt(cx, cy, rx, ry, xRotation, angle) {
- return rx * Math.sin(xRotation) * Math.cos(angle) + ry * Math.cos(xRotation) * Math.sin(angle) + cy;
- } // 获取点在椭圆上的角度
- function getAngle(rx, ry, x0, y0) {
- var angle = Math.atan2(y0 * rx, x0 * ry); // 转换到 0 - 2PI 内
- return (angle + Math.PI * 2) % (Math.PI * 2);
- } // 根据角度获取,x,y
- function getPoint(rx, ry, angle) {
- return {
- x: rx * Math.cos(angle),
- y: ry * Math.sin(angle)
- };
- } // 旋转
- function rotate(x, y, angle) {
- var cos = Math.cos(angle);
- var sin = Math.sin(angle);
- return [x * cos - y * sin, x * sin + y * cos];
- }
- exports.default = {
- /**
- * 计算包围盒
- * @param {number} cx 圆心 x
- * @param {number} cy 圆心 y
- * @param {number} rx x 轴方向的半径
- * @param {number} ry y 轴方向的半径
- * @param {number} xRotation 旋转角度
- * @param {number} startAngle 起始角度
- * @param {number} endAngle 结束角度
- * @return {object} 包围盒对象
- */
- box: function (cx, cy, rx, ry, xRotation, startAngle, endAngle) {
- var xDim = xExtrema(rx, ry, xRotation);
- var minX = Infinity;
- var maxX = -Infinity;
- var xs = [startAngle, endAngle];
- for (var i = -Math.PI * 2; i <= Math.PI * 2; i += Math.PI) {
- var xAngle = xDim + i;
- if (startAngle < endAngle) {
- if (startAngle < xAngle && xAngle < endAngle) {
- xs.push(xAngle);
- }
- } else {
- if (endAngle < xAngle && xAngle < startAngle) {
- xs.push(xAngle);
- }
- }
- }
- for (var i = 0; i < xs.length; i++) {
- var x = xAt(cx, cy, rx, ry, xRotation, xs[i]);
- if (x < minX) {
- minX = x;
- }
- if (x > maxX) {
- maxX = x;
- }
- }
- var yDim = yExtrema(rx, ry, xRotation);
- var minY = Infinity;
- var maxY = -Infinity;
- var ys = [startAngle, endAngle];
- for (var i = -Math.PI * 2; i <= Math.PI * 2; i += Math.PI) {
- var yAngle = yDim + i;
- if (startAngle < endAngle) {
- if (startAngle < yAngle && yAngle < endAngle) {
- ys.push(yAngle);
- }
- } else {
- if (endAngle < yAngle && yAngle < startAngle) {
- ys.push(yAngle);
- }
- }
- }
- for (var i = 0; i < ys.length; i++) {
- var y = yAt(cx, cy, rx, ry, xRotation, ys[i]);
- if (y < minY) {
- minY = y;
- }
- if (y > maxY) {
- maxY = y;
- }
- }
- return {
- x: minX,
- y: minY,
- width: maxX - minX,
- height: maxY - minY
- };
- },
- /**
- * 获取圆弧的长度,计算圆弧长度时不考虑旋转角度,
- * 仅跟 rx, ry, startAngle, endAngle 相关
- * @param {number} cx 圆心 x
- * @param {number} cy 圆心 y
- * @param {number} rx x 轴方向的半径
- * @param {number} ry y 轴方向的半径
- * @param {number} xRotation 旋转角度
- * @param {number} startAngle 起始角度
- * @param {number} endAngle 结束角度
- */
- length: function (cx, cy, rx, ry, xRotation, startAngle, endAngle) {},
- /**
- * 获取指定点到圆弧的最近距离的点
- * @param {number} cx 圆心 x
- * @param {number} cy 圆心 y
- * @param {number} rx x 轴方向的半径
- * @param {number} ry y 轴方向的半径
- * @param {number} xRotation 旋转角度
- * @param {number} startAngle 起始角度
- * @param {number} endAngle 结束角度
- * @param {number} x0 指定点的 x
- * @param {number} y0 指定点的 y
- * @return {object} 到指定点最近距离的点
- */
- nearestPoint: function (cx, cy, rx, ry, xRotation, startAngle, endAngle, x0, y0) {
- // 将最近距离问题转换成到椭圆中心 0,0 没有旋转的椭圆问题
- var relativeVector = rotate(x0 - cx, y0 - cy, -xRotation);
- var x1 = relativeVector[0],
- y1 = relativeVector[1]; // 计算点到椭圆的最近的点
- var relativePoint = ellipse_1.default.nearestPoint(0, 0, rx, ry, x1, y1); // 获取点在椭圆上的角度
- var angle = getAngle(rx, ry, relativePoint.x, relativePoint.y); // 点没有在圆弧上
- if (angle < startAngle) {
- // 小于起始圆弧
- relativePoint = getPoint(rx, ry, startAngle);
- } else if (angle > endAngle) {
- // 大于结束圆弧
- relativePoint = getPoint(rx, ry, endAngle);
- } // 旋转到 xRotation 的角度
- var vector = rotate(relativePoint.x, relativePoint.y, xRotation);
- return {
- x: vector[0] + cx,
- y: vector[1] + cy
- };
- },
- pointDistance: function (cx, cy, rx, ry, xRotation, startAngle, endAngle, x0, y0) {
- var nearestPoint = this.nearestPoint(cx, cy, rx, ry, x0, y0);
- return util_1.distance(nearestPoint.x, nearestPoint.y, x0, y0);
- },
- pointAt: function (cx, cy, rx, ry, xRotation, startAngle, endAngle, t) {
- var angle = (endAngle - startAngle) * t + startAngle;
- return {
- x: xAt(cx, cy, rx, ry, xRotation, angle),
- y: yAt(cx, cy, rx, ry, xRotation, angle)
- };
- },
- tangentAngle: function (cx, cy, rx, ry, xRotation, startAngle, endAngle, t) {
- var angle = (endAngle - startAngle) * t + startAngle;
- var dx = derivativeXAt(cx, cy, rx, ry, xRotation, startAngle, endAngle, angle);
- var dy = derivativeYAt(cx, cy, rx, ry, xRotation, startAngle, endAngle, angle);
- return util_1.piMod(Math.atan2(dy, dx));
- }
- };
- /***/ }),
- /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/bezier.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/bezier.js ***!
- \*********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
- var EPSILON = 0.0001;
- /**
- * 使用牛顿切割法求最近的点
- * @param {number[]} xArr 点的 x 数组
- * @param {number[]} yArr 点的 y 数组
- * @param {number} x 指定的点 x
- * @param {number} y 指定的点 y
- * @param {Function} tCallback 差值函数
- */
- function nearestPoint(xArr, yArr, x, y, tCallback) {
- var t;
- var interval = 0.005;
- var d = Infinity;
- var v0 = [x, y];
- for (var i = 0; i <= 20; i++) {
- var _t = i * 0.05;
- var v1 = [tCallback.apply(null, xArr.concat([_t])), tCallback.apply(null, yArr.concat([_t]))];
- var d1 = util_1.distance(v0[0], v0[1], v1[0], v1[1]);
- if (d1 < d) {
- t = _t;
- d = d1;
- }
- } // 提前终止
- if (t === 0) {
- return {
- x: xArr[0],
- y: yArr[0]
- };
- }
- if (t === 1) {
- var count = xArr.length;
- return {
- x: xArr[count - 1],
- y: yArr[count - 1]
- };
- }
- d = Infinity;
- for (var i = 0; i < 32; i++) {
- if (interval < EPSILON) {
- break;
- }
- var prev = t - interval;
- var next = t + interval;
- var v1 = [tCallback.apply(null, xArr.concat([prev])), tCallback.apply(null, yArr.concat([prev]))];
- var d1 = util_1.distance(v0[0], v0[1], v1[0], v1[1]);
- if (prev >= 0 && d1 < d) {
- t = prev;
- d = d1;
- } else {
- var v2 = [tCallback.apply(null, xArr.concat([next])), tCallback.apply(null, yArr.concat([next]))];
- var d2 = util_1.distance(v0[0], v0[1], v2[0], v2[1]);
- if (next <= 1 && d2 < d) {
- t = next;
- d = d2;
- } else {
- interval *= 0.5;
- }
- }
- }
- return {
- x: tCallback.apply(null, xArr.concat([t])),
- y: tCallback.apply(null, yArr.concat([t]))
- };
- }
- exports.nearestPoint = nearestPoint; // 近似求解 https://community.khronos.org/t/3d-cubic-bezier-segment-length/62363/2
- function snapLength(xArr, yArr) {
- var totalLength = 0;
- var count = xArr.length;
- for (var i = 0; i < count; i++) {
- var x = xArr[i];
- var y = yArr[i];
- var nextX = xArr[(i + 1) % count];
- var nextY = yArr[(i + 1) % count];
- totalLength += util_1.distance(x, y, nextX, nextY);
- }
- return totalLength / 2;
- }
- exports.snapLength = snapLength;
- /***/ }),
- /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/cubic.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/cubic.js ***!
- \********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
- var line_1 = __webpack_require__(/*! ./line */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js");
- var bezier_1 = __webpack_require__(/*! ./bezier */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/bezier.js");
- function cubicAt(p0, p1, p2, p3, t) {
- var onet = 1 - t; // t * t * t 的性能大概是 Math.pow(t, 3) 的三倍
- return onet * onet * onet * p0 + 3 * p1 * t * onet * onet + 3 * p2 * t * t * onet + p3 * t * t * t;
- }
- function derivativeAt(p0, p1, p2, p3, t) {
- var onet = 1 - t;
- return 3 * (onet * onet * (p1 - p0) + 2 * onet * t * (p2 - p1) + t * t * (p3 - p2));
- }
- function extrema(p0, p1, p2, p3) {
- var a = -3 * p0 + 9 * p1 - 9 * p2 + 3 * p3;
- var b = 6 * p0 - 12 * p1 + 6 * p2;
- var c = 3 * p1 - 3 * p0;
- var extremas = [];
- var t1;
- var t2;
- var discSqrt;
- if (util_1.isNumberEqual(a, 0)) {
- if (!util_1.isNumberEqual(b, 0)) {
- t1 = -c / b;
- if (t1 >= 0 && t1 <= 1) {
- extremas.push(t1);
- }
- }
- } else {
- var disc = b * b - 4 * a * c;
- if (util_1.isNumberEqual(disc, 0)) {
- extremas.push(-b / (2 * a));
- } else if (disc > 0) {
- discSqrt = Math.sqrt(disc);
- t1 = (-b + discSqrt) / (2 * a);
- t2 = (-b - discSqrt) / (2 * a);
- if (t1 >= 0 && t1 <= 1) {
- extremas.push(t1);
- }
- if (t2 >= 0 && t2 <= 1) {
- extremas.push(t2);
- }
- }
- }
- return extremas;
- } // 分割贝塞尔曲线
- function divideCubic(x1, y1, x2, y2, x3, y3, x4, y4, t) {
- // 划分点
- var xt = cubicAt(x1, x2, x3, x4, t);
- var yt = cubicAt(y1, y2, y3, y4, t); // 计算两点之间的差值点
- var c1 = line_1.default.pointAt(x1, y1, x2, y2, t);
- var c2 = line_1.default.pointAt(x2, y2, x3, y3, t);
- var c3 = line_1.default.pointAt(x3, y3, x4, y4, t);
- var c12 = line_1.default.pointAt(c1.x, c1.y, c2.x, c2.y, t);
- var c23 = line_1.default.pointAt(c2.x, c2.y, c3.x, c3.y, t);
- return [[x1, y1, c1.x, c1.y, c12.x, c12.y, xt, yt], [xt, yt, c23.x, c23.y, c3.x, c3.y, x4, y4]];
- } // 使用迭代法取贝塞尔曲线的长度,二阶和三阶分开写,更清晰和便于调试
- function cubicLength(x1, y1, x2, y2, x3, y3, x4, y4, iterationCount) {
- if (iterationCount === 0) {
- return bezier_1.snapLength([x1, x2, x3, x4], [y1, y2, y3, y4]);
- }
- var cubics = divideCubic(x1, y1, x2, y2, x3, y3, x4, y4, 0.5);
- var left = cubics[0];
- var right = cubics[1];
- left.push(iterationCount - 1);
- right.push(iterationCount - 1);
- return cubicLength.apply(null, left) + cubicLength.apply(null, right);
- }
- exports.default = {
- extrema: extrema,
- box: function (x1, y1, x2, y2, x3, y3, x4, y4) {
- var xArr = [x1, x4];
- var yArr = [y1, y4];
- var xExtrema = extrema(x1, x2, x3, x4);
- var yExtrema = extrema(y1, y2, y3, y4);
- for (var i = 0; i < xExtrema.length; i++) {
- xArr.push(cubicAt(x1, x2, x3, x4, xExtrema[i]));
- }
- for (var i = 0; i < yExtrema.length; i++) {
- yArr.push(cubicAt(y1, y2, y3, y4, yExtrema[i]));
- }
- return util_1.getBBoxByArray(xArr, yArr);
- },
- length: function (x1, y1, x2, y2, x3, y3, x4, y4) {
- // 迭代三次,划分成 8 段求长度
- return cubicLength(x1, y1, x2, y2, x3, y3, x4, y4, 3);
- },
- nearestPoint: function (x1, y1, x2, y2, x3, y3, x4, y4, x0, y0) {
- return bezier_1.nearestPoint([x1, x2, x3, x4], [y1, y2, y3, y4], x0, y0, cubicAt);
- },
- pointDistance: function (x1, y1, x2, y2, x3, y3, x4, y4, x0, y0) {
- var point = this.nearestPoint(x1, y1, x2, y2, x3, y3, x4, y4, x0, y0);
- return util_1.distance(point.x, point.y, x0, y0);
- },
- interpolationAt: cubicAt,
- pointAt: function (x1, y1, x2, y2, x3, y3, x4, y4, t) {
- return {
- x: cubicAt(x1, x2, x3, x4, t),
- y: cubicAt(y1, y2, y3, y4, t)
- };
- },
- divide: function (x1, y1, x2, y2, x3, y3, x4, y4, t) {
- return divideCubic(x1, y1, x2, y2, x3, y3, x4, y4, t);
- },
- tangentAngle: function (x1, y1, x2, y2, x3, y3, x4, y4, t) {
- var dx = derivativeAt(x1, x2, x3, x4, t);
- var dy = derivativeAt(y1, y2, y3, y4, t);
- return util_1.piMod(Math.atan2(dy, dx));
- }
- };
- /***/ }),
- /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/ellipse.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/ellipse.js ***!
- \**********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview 椭圆的一些计算,
- * - 周长计算参考:https://www.mathsisfun.com/geometry/ellipse-perimeter.html
- * - 距离计算参考:https://wet-robots.ghost.io/simple-method-for-distance-to-ellipse/
- * @author dxq613@gmail.com
- */
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
- function copysign(v1, v2) {
- var absv = Math.abs(v1);
- return v2 > 0 ? absv : absv * -1;
- }
- exports.default = {
- /**
- * 包围盒计算
- * @param {number} x 椭圆中心 x
- * @param {number} y 椭圆中心 y
- * @param {number} rx 椭圆 x 方向半径
- * @param {number} ry 椭圆 y 方向半径
- * @return {object} 包围盒
- */
- box: function (x, y, rx, ry) {
- return {
- x: x - rx,
- y: y - ry,
- width: rx * 2,
- height: ry * 2
- };
- },
- /**
- * 计算周长,使用近似法
- * @param {number} x 椭圆中心 x
- * @param {number} y 椭圆中心 y
- * @param {number} rx 椭圆 x 方向半径
- * @param {number} ry 椭圆 y 方向半径
- * @return {number} 椭圆周长
- */
- length: function (x, y, rx, ry) {
- return Math.PI * (3 * (rx + ry) - Math.sqrt((3 * rx + ry) * (rx + 3 * ry)));
- },
- /**
- * 距离椭圆最近的点
- * @param {number} x 椭圆中心 x
- * @param {number} y 椭圆中心 y
- * @param {number} rx 椭圆 x 方向半径
- * @param {number} ry 椭圆 y 方向半径
- * @param {number} x0 指定的点 x
- * @param {number} y0 指定的点 y
- * @return {object} 椭圆上距离指定点最近的点
- */
- nearestPoint: function (x, y, rx, ry, x0, y0) {
- var a = rx;
- var b = ry; // 假如椭圆半径为0则返回圆心
- if (a === 0 || b === 0) {
- return {
- x: x,
- y: y
- };
- } // 转换成 0, 0 为中心的椭圆计算
- var relativeX = x0 - x;
- var relativeY = y0 - y;
- var px = Math.abs(relativeX);
- var py = Math.abs(relativeY);
- var squareA = a * a;
- var squareB = b * b; // const angle0 = Math.atan2(relativeY, relativeX);
- var t = Math.PI / 4;
- var nearestX; // 椭圆上的任一点
- var nearestY; // 迭代 4 次
- for (var i = 0; i < 4; i++) {
- nearestX = a * Math.cos(t);
- nearestY = b * Math.sin(t);
- var ex = (squareA - squareB) * Math.pow(Math.cos(t), 3) / a;
- var ey = (squareB - squareA) * Math.pow(Math.sin(t), 3) / b;
- var rx1 = nearestX - ex;
- var ry1 = nearestY - ey;
- var qx = px - ex;
- var qy = py - ey;
- var r = Math.hypot(ry1, rx1);
- var q = Math.hypot(qy, qx);
- var delta_c = r * Math.asin((rx1 * qy - ry1 * qx) / (r * q));
- var delta_t = delta_c / Math.sqrt(squareA + squareB - nearestX * nearestX - nearestY * nearestY);
- t += delta_t;
- t = Math.min(Math.PI / 2, Math.max(0, t));
- }
- return {
- x: x + copysign(nearestX, relativeX),
- y: y + copysign(nearestY, relativeY)
- };
- },
- /**
- * 点到椭圆最近的距离
- * @param {number} x 椭圆中心 x
- * @param {number} y 椭圆中心 y
- * @param {number} rx 椭圆 x 方向半径
- * @param {number} ry 椭圆 y 方向半径
- * @param {number} x0 指定的点 x
- * @param {number} y0 指定的点 y
- * @return {number} 点到椭圆的距离
- */
- pointDistance: function (x, y, rx, ry, x0, y0) {
- var nearestPoint = this.nearestPoint(x, y, rx, ry, x0, y0);
- return util_1.distance(nearestPoint.x, nearestPoint.y, x0, y0);
- },
- /**
- * 根据比例获取点
- * @param {number} x 椭圆中心 x
- * @param {number} y 椭圆中心 y
- * @param {number} rx 椭圆 x 方向半径
- * @param {number} ry 椭圆 y 方向半径
- * @param {number} t 指定比例,x轴方向为 0
- * @return {object} 点
- */
- pointAt: function (x, y, rx, ry, t) {
- var angle = 2 * Math.PI * t; // 按照角度进行计算,而不按照周长计算
- return {
- x: x + rx * Math.cos(angle),
- y: y + ry * Math.sin(angle)
- };
- },
- /**
- * 根据比例计算切线角度
- * @param {number} x 椭圆中心 x
- * @param {number} y 椭圆中心 y
- * @param {number} rx 椭圆 x 方向半径
- * @param {number} ry 椭圆 y 方向半径
- * @param {number} t 指定比例 0 - 1 之间,x轴方向为 0。在 0-1 范围之外是循环还是返回 null,还需要调整
- * @return {number} 角度,在 0 - 2PI 之间
- */
- tangentAngle: function (x, y, rx, ry, t) {
- var angle = 2 * Math.PI * t; // 按照角度进行计算,而不按照周长计算
- // 直接使用 x,y 的导数计算, x' = -rx * sin(t); y' = ry * cos(t);
- var tangentAngle = Math.atan2(ry * Math.cos(angle), -rx * Math.sin(angle)); // 也可以使用指定点的切线方程计算,成本有些高
- // const point = this.pointAt(0, 0, rx, ry, t); // 椭圆的切线同椭圆的中心不相关
- // let tangentAngle = -1 * Math.atan((ry * ry * point.x) / (rx * rx * point.y));
- // if (angle >= 0 && angle <= Math.PI) {
- // tangentAngle += Math.PI;
- // }
- return util_1.piMod(tangentAngle);
- }
- };
- /***/ }),
- /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js ***!
- \*******************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
- var vec2 = __webpack_require__(/*! gl-matrix/vec2 */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec2.js");
- exports.default = {
- /**
- * 计算线段的包围盒
- * @param {number} x1 起始点 x
- * @param {number} y1 起始点 y
- * @param {number} x2 结束点 x
- * @param {number} y2 结束点 y
- * @return {object} 包围盒对象
- */
- box: function (x1, y1, x2, y2) {
- return util_1.getBBoxByArray([x1, x2], [y1, y2]);
- },
- /**
- * 线段的长度
- * @param {number} x1 起始点 x
- * @param {number} y1 起始点 y
- * @param {number} x2 结束点 x
- * @param {number} y2 结束点 y
- * @return {number} 距离
- */
- length: function (x1, y1, x2, y2) {
- return util_1.distance(x1, y1, x2, y2);
- },
- /**
- * 根据比例获取点
- * @param {number} x1 起始点 x
- * @param {number} y1 起始点 y
- * @param {number} x2 结束点 x
- * @param {number} y2 结束点 y
- * @param {number} t 指定比例
- * @return {object} 包含 x, y 的点
- */
- pointAt: function (x1, y1, x2, y2, t) {
- return {
- x: (1 - t) * x1 + t * x2,
- y: (1 - t) * y1 + t * y2
- };
- },
- /**
- * 点到线段的距离
- * @param {number} x1 起始点 x
- * @param {number} y1 起始点 y
- * @param {number} x2 结束点 x
- * @param {number} y2 结束点 y
- * @param {number} x 测试点 x
- * @param {number} y 测试点 y
- * @return {number} 距离
- */
- pointDistance: function (x1, y1, x2, y2, x, y) {
- // 投影距离 x1, y1 的向量,假设 p, p1, p2 三个点,投影点为 a
- // p1a = p1p.p1p2/|p1p2| * (p1p 的单位向量)
- var cross = (x2 - x1) * (x - x1) + (y2 - y1) * (y - y1);
- if (cross < 0) {
- return util_1.distance(x1, y1, x, y);
- }
- var lengthSquare = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
- if (cross > lengthSquare) {
- return util_1.distance(x2, y2, x, y);
- }
- return this.pointToLine(x1, y1, x2, y2, x, y);
- },
- /**
- * 点到直线的距离,而不是点到线段的距离
- * @param {number} x1 起始点 x
- * @param {number} y1 起始点 y
- * @param {number} x2 结束点 x
- * @param {number} y2 结束点 y
- * @param {number} x 测试点 x
- * @param {number} y 测试点 y
- * @return {number} 距离
- */
- pointToLine: function (x1, y1, x2, y2, x, y) {
- var d = [x2 - x1, y2 - y1]; // 如果端点相等,则判定点到点的距离
- if (vec2.exactEquals(d, [0, 0])) {
- return Math.sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1));
- }
- var u = [-d[1], d[0]];
- vec2.normalize(u, u);
- var a = [x - x1, y - y1];
- return Math.abs(vec2.dot(a, u));
- },
- /**
- * 线段的角度
- * @param {number} x1 起始点 x
- * @param {number} y1 起始点 y
- * @param {number} x2 结束点 x
- * @param {number} y2 结束点 y
- * @return {number} 导数
- */
- tangentAngle: function (x1, y1, x2, y2) {
- return Math.atan2(y2 - y1, x2 - x1);
- }
- };
- /***/ }),
- /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/polyline.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/polyline.js ***!
- \***********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var segments_1 = __webpack_require__(/*! ./segments */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/segments.js");
- var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
- exports.default = {
- /**
- * 计算多折线的包围盒
- * @param {array} points 点的集合 [x,y] 的形式
- * @return {object} 包围盒
- */
- box: function (points) {
- var xArr = [];
- var yArr = [];
- for (var i = 0; i < points.length; i++) {
- var point = points[i];
- xArr.push(point[0]);
- yArr.push(point[1]);
- }
- return util_1.getBBoxByArray(xArr, yArr);
- },
- /**
- * 计算多折线的长度
- * @param {array} points 点的集合 [x,y] 的形式
- * @return {object} 多条边的长度
- */
- length: function (points) {
- return segments_1.lengthOfSegment(points);
- },
- /**
- * 根据比例获取多折线的点
- * @param {array} points 点的集合 [x,y] 的形式
- * @param {number} t 在多折线的长度上的比例
- * @return {object} 根据比例值计算出来的点
- */
- pointAt: function (points, t) {
- return segments_1.pointAtSegments(points, t);
- },
- /**
- * 指定点到多折线的距离
- * @param {array} points 点的集合 [x,y] 的形式
- * @param {number} x 指定点的 x
- * @param {number} y 指定点的 y
- * @return {number} 点到多折线的距离
- */
- pointDistance: function (points, x, y) {
- return segments_1.distanceAtSegment(points, x, y);
- },
- /**
- * 根据比例获取多折线的切线角度
- * @param {array} points 点的集合 [x,y] 的形式
- * @param {number} t 在多折线的长度上的比例
- * @return {object} 根据比例值计算出来的角度
- */
- tangentAngle: function (points, t) {
- return segments_1.angleAtSegments(points, t);
- }
- };
- /***/ }),
- /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/quadratic.js":
- /*!************************************************************************!*\
- !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/quadratic.js ***!
- \************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var line_1 = __webpack_require__(/*! ./line */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js");
- var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
- var bezier_1 = __webpack_require__(/*! ./bezier */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/bezier.js"); // 差值公式
- function quadraticAt(p0, p1, p2, t) {
- var onet = 1 - t;
- return onet * onet * p0 + 2 * t * onet * p1 + t * t * p2;
- } // 求极值
- function extrema(p0, p1, p2) {
- var a = p0 + p2 - 2 * p1;
- if (util_1.isNumberEqual(a, 0)) {
- return [0.5];
- }
- var rst = (p0 - p1) / a;
- if (rst <= 1 && rst >= 0) {
- return [rst];
- }
- return [];
- }
- function derivativeAt(p0, p1, p2, t) {
- return 2 * (1 - t) * (p1 - p0) + 2 * t * (p2 - p1);
- } // 分割贝塞尔曲线
- function divideQuadratic(x1, y1, x2, y2, x3, y3, t) {
- // 划分点
- var xt = quadraticAt(x1, x2, x3, t);
- var yt = quadraticAt(y1, y2, y3, t); // 分割的第一条曲线的控制点
- var controlPoint1 = line_1.default.pointAt(x1, y1, x2, y2, t); // 分割的第二条曲线的控制点
- var controlPoint2 = line_1.default.pointAt(x2, y2, x3, y3, t);
- return [[x1, y1, controlPoint1.x, controlPoint1.y, xt, yt], [xt, yt, controlPoint2.x, controlPoint2.y, x3, y3]];
- } // 使用迭代法取贝塞尔曲线的长度
- function quadraticLength(x1, y1, x2, y2, x3, y3, iterationCount) {
- if (iterationCount === 0) {
- return (util_1.distance(x1, y1, x2, y2) + util_1.distance(x2, y2, x3, y3) + util_1.distance(x1, y1, x3, y3)) / 2;
- }
- var quadratics = divideQuadratic(x1, y1, x2, y2, x3, y3, 0.5);
- var left = quadratics[0];
- var right = quadratics[1];
- left.push(iterationCount - 1);
- right.push(iterationCount - 1);
- return quadraticLength.apply(null, left) + quadraticLength.apply(null, right);
- }
- exports.default = {
- box: function (x1, y1, x2, y2, x3, y3) {
- var xExtrema = extrema(x1, x2, x3)[0];
- var yExtrema = extrema(y1, y2, y3)[0]; // 控制点不加入 box 的计算
- var xArr = [x1, x3];
- var yArr = [y1, y3];
- if (xExtrema !== undefined) {
- xArr.push(quadraticAt(x1, x2, x3, xExtrema));
- }
- if (yExtrema !== undefined) {
- yArr.push(quadraticAt(y1, y2, y3, yExtrema));
- }
- return util_1.getBBoxByArray(xArr, yArr);
- },
- length: function (x1, y1, x2, y2, x3, y3) {
- return quadraticLength(x1, y1, x2, y2, x3, y3, 3);
- },
- nearestPoint: function (x1, y1, x2, y2, x3, y3, x0, y0) {
- return bezier_1.nearestPoint([x1, x2, x3], [y1, y2, y3], x0, y0, quadraticAt);
- },
- pointDistance: function (x1, y1, x2, y2, x3, y3, x0, y0) {
- var point = this.nearestPoint(x1, y1, x2, y2, x3, y3, x0, y0);
- return util_1.distance(point.x, point.y, x0, y0);
- },
- interpolationAt: quadraticAt,
- pointAt: function (x1, y1, x2, y2, x3, y3, t) {
- return {
- x: quadraticAt(x1, x2, x3, t),
- y: quadraticAt(y1, y2, y3, t)
- };
- },
- divide: function (x1, y1, x2, y2, x3, y3, t) {
- return divideQuadratic(x1, y1, x2, y2, x3, y3, t);
- },
- tangentAngle: function (x1, y1, x2, y2, x3, y3, t) {
- var dx = derivativeAt(x1, x2, x3, t);
- var dy = derivativeAt(y1, y2, y3, t);
- var angle = Math.atan2(dy, dx);
- return util_1.piMod(angle);
- }
- };
- /***/ }),
- /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/segments.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/segments.js ***!
- \***********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var line_1 = __webpack_require__(/*! ./line */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js");
- var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
- function analyzePoints(points) {
- // 计算每段的长度和总的长度
- var totalLength = 0;
- var segments = [];
- for (var i = 0; i < points.length - 1; i++) {
- var from = points[i];
- var to = points[i + 1];
- var length_1 = util_1.distance(from[0], from[1], to[0], to[1]);
- var seg = {
- from: from,
- to: to,
- length: length_1
- };
- segments.push(seg);
- totalLength += length_1;
- }
- return {
- segments: segments,
- totalLength: totalLength
- };
- }
- function lengthOfSegment(points) {
- if (points.length < 2) {
- return 0;
- }
- var totalLength = 0;
- for (var i = 0; i < points.length - 1; i++) {
- var from = points[i];
- var to = points[i + 1];
- totalLength += util_1.distance(from[0], from[1], to[0], to[1]);
- }
- return totalLength;
- }
- exports.lengthOfSegment = lengthOfSegment;
- /**
- * 按照比例在数据片段中获取点
- * @param {array} points 点的集合
- * @param {number} t 百分比 0-1
- * @return {object} 点的坐标
- */
- function pointAtSegments(points, t) {
- // 边界判断
- if (t > 1 || t < 0 || points.length < 2) {
- return null;
- }
- var _a = analyzePoints(points),
- segments = _a.segments,
- totalLength = _a.totalLength; // 多个点有可能重合
- if (totalLength === 0) {
- return {
- x: points[0][0],
- y: points[0][1]
- };
- } // 计算比例
- var startRatio = 0;
- var point = null;
- for (var i = 0; i < segments.length; i++) {
- var seg = segments[i];
- var from = seg.from,
- to = seg.to;
- var currentRatio = seg.length / totalLength;
- if (t >= startRatio && t <= startRatio + currentRatio) {
- var localRatio = (t - startRatio) / currentRatio;
- point = line_1.default.pointAt(from[0], from[1], to[0], to[1], localRatio);
- break;
- }
- startRatio += currentRatio;
- }
- return point;
- }
- exports.pointAtSegments = pointAtSegments;
- /**
- * 按照比例在数据片段中获取切线的角度
- * @param {array} points 点的集合
- * @param {number} t 百分比 0-1
- */
- function angleAtSegments(points, t) {
- // 边界判断
- if (t > 1 || t < 0 || points.length < 2) {
- return 0;
- }
- var _a = analyzePoints(points),
- segments = _a.segments,
- totalLength = _a.totalLength; // 计算比例
- var startRatio = 0;
- var angle = 0;
- for (var i = 0; i < segments.length; i++) {
- var seg = segments[i];
- var from = seg.from,
- to = seg.to;
- var currentRatio = seg.length / totalLength;
- if (t >= startRatio && t <= startRatio + currentRatio) {
- angle = Math.atan2(to[1] - from[1], to[0] - from[0]);
- break;
- }
- startRatio += currentRatio;
- }
- return angle;
- }
- exports.angleAtSegments = angleAtSegments;
- function distanceAtSegment(points, x, y) {
- var minDistance = Infinity;
- for (var i = 0; i < points.length - 1; i++) {
- var point = points[i];
- var nextPoint = points[i + 1];
- var distance_1 = line_1.default.pointDistance(point[0], point[1], nextPoint[0], nextPoint[1], x, y);
- if (distance_1 < minDistance) {
- minDistance = distance_1;
- }
- }
- return minDistance;
- }
- exports.distanceAtSegment = distanceAtSegment;
- /***/ }),
- /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js ***!
- \*******************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- function minNum(array) {
- return Math.min.apply(null, array);
- }
- function maxNum(array) {
- return Math.max.apply(null, array);
- }
- /**
- * 两点之间的距离
- * @param {number} x1 起始点 x
- * @param {number} y1 起始点 y
- * @param {number} x2 结束点 x
- * @param {number} y2 结束点 y
- * @return {number} 距离
- */
- function distance(x1, y1, x2, y2) {
- var dx = x1 - x2;
- var dy = y1 - y2;
- return Math.sqrt(dx * dx + dy * dy);
- }
- exports.distance = distance;
- function isNumberEqual(v1, v2) {
- return Math.abs(v1 - v2) < 0.001;
- }
- exports.isNumberEqual = isNumberEqual;
- function getBBoxByArray(xArr, yArr) {
- var minX = minNum(xArr);
- var minY = minNum(yArr);
- var maxX = maxNum(xArr);
- var maxY = maxNum(yArr);
- return {
- x: minX,
- y: minY,
- width: maxX - minX,
- height: maxY - minY
- };
- }
- exports.getBBoxByArray = getBBoxByArray;
- function getBBoxRange(x1, y1, x2, y2) {
- return {
- minX: minNum([x1, x2]),
- maxX: maxNum([x1, x2]),
- minY: minNum([y1, y2]),
- maxY: maxNum([y1, y2])
- };
- }
- exports.getBBoxRange = getBBoxRange;
- function piMod(angle) {
- return (angle + Math.PI * 2) % (Math.PI * 2);
- }
- exports.piMod = piMod;
- /***/ }),
- /***/ "./node_modules/_@antv_matrix-util@3.0.3@@antv/matrix-util/lib/mat3.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/_@antv_matrix-util@3.0.3@@antv/matrix-util/lib/mat3.js ***!
- \*****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- tslib_1.__exportStar(__webpack_require__(/*! gl-matrix/mat3 */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat3.js"), exports);
- var mat3_1 = __webpack_require__(/*! gl-matrix/mat3 */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat3.js");
- function leftTranslate(out, a, v) {
- var transMat = new Array(9);
- mat3_1.fromTranslation(transMat, v);
- return mat3_1.multiply(out, transMat, a);
- }
- function leftRotate(out, a, rad) {
- var rotateMat = new Array(9);
- mat3_1.fromRotation(rotateMat, rad);
- return mat3_1.multiply(out, rotateMat, a);
- }
- function leftScale(out, a, v) {
- var scaleMat = new Array(9);
- mat3_1.fromScaling(scaleMat, v);
- return mat3_1.multiply(out, scaleMat, a);
- }
- function leftMultiply(out, a, a1) {
- return mat3_1.multiply(out, a1, a);
- }
- /**
- * 根据 actions 来做 transform
- * @param m
- * @param actions
- */
- function transform(m, actions) {
- var matrix = m ? [].concat(m) : [1, 0, 0, 0, 1, 0, 0, 0, 1];
- for (var i = 0, len = actions.length; i < len; i++) {
- var action = actions[i];
- switch (action[0]) {
- case 't':
- leftTranslate(matrix, matrix, [action[1], action[2]]);
- break;
- case 's':
- leftScale(matrix, matrix, [action[1], action[2]]);
- break;
- case 'r':
- leftRotate(matrix, matrix, action[1]);
- break;
- case 'm':
- leftMultiply(matrix, matrix, action[1]);
- break;
- default:
- break;
- }
- }
- return matrix;
- }
- exports.transform = transform;
- /***/ }),
- /***/ "./node_modules/_@antv_matrix-util@3.1.0-beta.2@@antv/matrix-util/esm/ext.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/_@antv_matrix-util@3.1.0-beta.2@@antv/matrix-util/esm/ext.js ***!
- \***********************************************************************************/
- /*! exports provided: leftTranslate, leftRotate, leftScale, transform, direction, angleTo, vertical */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "leftTranslate", function() { return leftTranslate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "leftRotate", function() { return leftRotate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "leftScale", function() { return leftScale; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transform", function() { return transform; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "direction", function() { return direction; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "angleTo", function() { return angleTo; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vertical", function() { return vertical; });
- /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/index.js");
- /**
- * @description 扩展方法,提供 gl-matrix 为提供的方法
- * */
- function leftTranslate(out, a, v) {
- var transMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];
- gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"].fromTranslation(transMat, v);
- return gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"].multiply(out, transMat, a);
- }
- function leftRotate(out, a, rad) {
- var rotateMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];
- gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"].fromRotation(rotateMat, rad);
- return gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"].multiply(out, rotateMat, a);
- }
- function leftScale(out, a, v) {
- var scaleMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];
- gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"].fromScaling(scaleMat, v);
- return gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"].multiply(out, scaleMat, a);
- }
- function leftMultiply(out, a, a1) {
- return gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"].multiply(out, a1, a);
- }
- /**
- * 根据 actions 来做 transform
- * @param m
- * @param actions
- */
- function transform(m, actions) {
- var matrix = m ? [].concat(m) : [1, 0, 0, 0, 1, 0, 0, 0, 1];
- for (var i = 0, len = actions.length; i < len; i++) {
- var action = actions[i];
- switch (action[0]) {
- case 't':
- leftTranslate(matrix, matrix, [action[1], action[2]]);
- break;
- case 's':
- leftScale(matrix, matrix, [action[1], action[2]]);
- break;
- case 'r':
- leftRotate(matrix, matrix, action[1]);
- break;
- case 'm':
- leftMultiply(matrix, matrix, action[1]);
- break;
- default:
- break;
- }
- }
- return matrix;
- }
- /**
- * 向量 v1 到 向量 v2 夹角的方向
- * @param {Array} v1 向量
- * @param {Array} v2 向量
- * @return {Boolean} >= 0 顺时针 < 0 逆时针
- */
- function direction(v1, v2) {
- return v1[0] * v2[1] - v2[0] * v1[1];
- }
- /**
- * 二维向量 v1 到 v2 的夹角
- * @param v1
- * @param v2
- * @param direct
- */
- function angleTo(v1, v2, direct) {
- var ang = gl_matrix__WEBPACK_IMPORTED_MODULE_0__["vec2"].angle(v1, v2);
- var angleLargeThanPI = direction(v1, v2) >= 0;
- if (direct) {
- if (angleLargeThanPI) {
- return Math.PI * 2 - ang;
- }
- return ang;
- }
- if (angleLargeThanPI) {
- return ang;
- }
- return Math.PI * 2 - ang;
- }
- /**
- * 计算二维向量的垂直向量
- * @param out
- * @param v
- * @param flag
- */
- function vertical(out, v, flag) {
- if (flag) {
- out[0] = v[1];
- out[1] = -1 * v[0];
- } else {
- out[0] = -1 * v[1];
- out[1] = v[0];
- }
- return out;
- }
- /***/ }),
- /***/ "./node_modules/_@antv_matrix-util@3.1.0-beta.2@@antv/matrix-util/esm/index.js":
- /*!*************************************************************************************!*\
- !*** ./node_modules/_@antv_matrix-util@3.1.0-beta.2@@antv/matrix-util/esm/index.js ***!
- \*************************************************************************************/
- /*! exports provided: mat3, vec2, vec3, ext */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/index.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mat3", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "vec2", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__["vec2"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "vec3", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__["vec3"]; });
- /* harmony import */ var _ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ext */ "./node_modules/_@antv_matrix-util@3.1.0-beta.2@@antv/matrix-util/esm/ext.js");
- /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "ext", function() { return _ext__WEBPACK_IMPORTED_MODULE_1__; });
- /***/ }),
- /***/ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/get-arc-params.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/get-arc-params.js ***!
- \***********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var mod_1 = __webpack_require__(/*! @antv/util/lib/mod */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mod.js");
- var to_radian_1 = __webpack_require__(/*! @antv/util/lib/to-radian */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-radian.js"); // 向量长度
- function vMag(v) {
- return Math.sqrt(v[0] * v[0] + v[1] * v[1]);
- } // u.v/|u||v|,计算夹角的余弦值
- function vRatio(u, v) {
- // 当存在一个向量的长度为 0 时,夹角也为 0,即夹角的余弦值为 1
- return vMag(u) * vMag(v) ? (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)) : 1;
- } // 向量角度
- function vAngle(u, v) {
- return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));
- }
- /**
- * 判断两个点是否重合,点坐标的格式为 [x, y]
- * @param {Array} point1 第一个点
- * @param {Array} point2 第二个点
- */
- function isSamePoint(point1, point2) {
- return point1[0] === point2[0] && point1[1] === point2[1];
- }
- exports.isSamePoint = isSamePoint; // A 0:rx 1:ry 2:x-axis-rotation 3:large-arc-flag 4:sweep-flag 5: x 6: y
- function getArcParams(startPoint, params) {
- var rx = params[1];
- var ry = params[2];
- var xRotation = mod_1.default(to_radian_1.default(params[3]), Math.PI * 2);
- var arcFlag = params[4];
- var sweepFlag = params[5]; // 弧形起点坐标
- var x1 = startPoint[0];
- var y1 = startPoint[1]; // 弧形终点坐标
- var x2 = params[6];
- var y2 = params[7];
- var xp = Math.cos(xRotation) * (x1 - x2) / 2.0 + Math.sin(xRotation) * (y1 - y2) / 2.0;
- var yp = -1 * Math.sin(xRotation) * (x1 - x2) / 2.0 + Math.cos(xRotation) * (y1 - y2) / 2.0;
- var lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry);
- if (lambda > 1) {
- rx *= Math.sqrt(lambda);
- ry *= Math.sqrt(lambda);
- }
- var diff = rx * rx * (yp * yp) + ry * ry * (xp * xp);
- var f = diff ? Math.sqrt((rx * rx * (ry * ry) - diff) / diff) : 1;
- if (arcFlag === sweepFlag) {
- f *= -1;
- }
- if (isNaN(f)) {
- f = 0;
- } // 旋转前的起点坐标,且当长半轴和短半轴的长度为 0 时,坐标按 (0, 0) 处理
- var cxp = ry ? f * rx * yp / ry : 0;
- var cyp = rx ? f * -ry * xp / rx : 0; // 椭圆圆心坐标
- var cx = (x1 + x2) / 2.0 + Math.cos(xRotation) * cxp - Math.sin(xRotation) * cyp;
- var cy = (y1 + y2) / 2.0 + Math.sin(xRotation) * cxp + Math.cos(xRotation) * cyp; // 起始点的单位向量
- var u = [(xp - cxp) / rx, (yp - cyp) / ry]; // 终止点的单位向量
- var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry]; // 计算起始点和圆心的连线,与 x 轴正方向的夹角
- var theta = vAngle([1, 0], u); // 计算圆弧起始点和终止点与椭圆圆心连线的夹角
- var dTheta = vAngle(u, v);
- if (vRatio(u, v) <= -1) {
- dTheta = Math.PI;
- }
- if (vRatio(u, v) >= 1) {
- dTheta = 0;
- }
- if (sweepFlag === 0 && dTheta > 0) {
- dTheta = dTheta - 2 * Math.PI;
- }
- if (sweepFlag === 1 && dTheta < 0) {
- dTheta = dTheta + 2 * Math.PI;
- }
- return {
- cx: cx,
- cy: cy,
- // 弧形的起点和终点相同时,长轴和短轴的长度按 0 处理
- rx: isSamePoint(startPoint, [x2, y2]) ? 0 : rx,
- ry: isSamePoint(startPoint, [x2, y2]) ? 0 : ry,
- startAngle: theta,
- endAngle: theta + dTheta,
- xRotation: xRotation,
- arcFlag: arcFlag,
- sweepFlag: sweepFlag
- };
- }
- exports.default = getArcParams;
- /***/ }),
- /***/ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/parse-path-string.js":
- /*!**************************************************************************************!*\
- !*** ./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/parse-path-string.js ***!
- \**************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var is_array_1 = __webpack_require__(/*! @antv/util/lib/is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
- var SPACES = '\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029';
- var PATH_COMMAND = new RegExp('([a-z])[' + SPACES + ',]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[' + SPACES + ']*,?[' + SPACES + ']*)+)', 'ig');
- var PATH_VALUES = new RegExp('(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[' + SPACES + ']*,?[' + SPACES + ']*', 'ig'); // Parses given path string into an array of arrays of path segments
- function parsePathString(pathString) {
- if (!pathString) {
- return null;
- }
- if (is_array_1.default(pathString)) {
- return pathString;
- }
- var paramCounts = {
- a: 7,
- c: 6,
- o: 2,
- h: 1,
- l: 2,
- m: 2,
- r: 4,
- q: 4,
- s: 4,
- t: 2,
- v: 1,
- u: 3,
- z: 0
- };
- var data = [];
- String(pathString).replace(PATH_COMMAND, function (a, b, c) {
- var params = [];
- var name = b.toLowerCase();
- c.replace(PATH_VALUES, function (a, b) {
- b && params.push(+b);
- });
- if (name === 'm' && params.length > 2) {
- data.push([b].concat(params.splice(0, 2)));
- name = 'l';
- b = b === 'm' ? 'l' : 'L';
- }
- if (name === 'o' && params.length === 1) {
- data.push([b, params[0]]);
- }
- if (name === 'r') {
- data.push([b].concat(params));
- } else {
- while (params.length >= paramCounts[name]) {
- data.push([b].concat(params.splice(0, paramCounts[name])));
- if (!paramCounts[name]) {
- break;
- }
- }
- }
- return '';
- });
- return data;
- }
- exports.default = parsePathString;
- /***/ }),
- /***/ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/parse-path.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/parse-path.js ***!
- \*******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var each_1 = __webpack_require__(/*! @antv/util/lib/each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
- var is_array_1 = __webpack_require__(/*! @antv/util/lib/is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
- var is_string_1 = __webpack_require__(/*! @antv/util/lib/is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js");
- var regexTags = /[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/ig;
- var regexDot = /[^\s\,]+/ig;
- function parsePath(p) {
- var path = p || [];
- if (is_array_1.default(path)) {
- return path;
- }
- if (is_string_1.default(path)) {
- path = path.match(regexTags);
- each_1.default(path, function (item, index) {
- // @ts-ignore
- item = item.match(regexDot);
- if (item[0].length > 1) {
- var tag = item[0].charAt(0); // @ts-ignore
- item.splice(1, 0, item[0].substr(1)); // @ts-ignore
- item[0] = tag;
- } // @ts-ignore
- each_1.default(item, function (sub, i) {
- if (!isNaN(sub)) {
- // @ts-ignore
- item[i] = +sub;
- }
- }); // @ts-ignore
- path[index] = item;
- });
- return path;
- }
- }
- exports.default = parsePath;
- /***/ }),
- /***/ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-absolute.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-absolute.js ***!
- \************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var parse_path_string_1 = __webpack_require__(/*! ./parse-path-string */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/parse-path-string.js");
- var REGEX_MD = /[a-z]/;
- function toSymmetry(p, c) {
- return [c[0] + (c[0] - p[0]), c[1] + (c[1] - p[1])];
- }
- function pathToAbsolute(pathString) {
- var pathArray = parse_path_string_1.default(pathString);
- if (!pathArray || !pathArray.length) {
- return [['M', 0, 0]];
- }
- var needProcess = false; // 如果存在小写的命令或者 V,H,T,S 则需要处理
- for (var i = 0; i < pathArray.length; i++) {
- var cmd = pathArray[i][0]; // 如果存在相对位置的命令,则中断返回
- if (REGEX_MD.test(cmd) || ['V', 'H', 'T', 'S'].indexOf(cmd) >= 0) {
- needProcess = true;
- break;
- }
- } // 如果不存在相对命令,则直接返回
- // 如果在业务上都写绝对路径,这种方式最快,仅做了一次检测
- if (!needProcess) {
- return pathArray;
- }
- var res = [];
- var x = 0;
- var y = 0;
- var mx = 0;
- var my = 0;
- var start = 0;
- var pa0;
- var dots;
- var first = pathArray[0];
- if (first[0] === 'M' || first[0] === 'm') {
- x = +first[1];
- y = +first[2];
- mx = x;
- my = y;
- start++;
- res[0] = ['M', x, y];
- }
- for (var i = start, ii = pathArray.length; i < ii; i++) {
- var pa = pathArray[i];
- var preParams = res[i - 1]; // 取前一个已经处理后的节点,否则会出现问题
- var r = [];
- var cmd = pa[0];
- var upCmd = cmd.toUpperCase();
- if (cmd !== upCmd) {
- r[0] = upCmd;
- switch (upCmd) {
- case 'A':
- r[1] = pa[1];
- r[2] = pa[2];
- r[3] = pa[3];
- r[4] = pa[4];
- r[5] = pa[5];
- r[6] = +pa[6] + x;
- r[7] = +pa[7] + y;
- break;
- case 'V':
- r[1] = +pa[1] + y;
- break;
- case 'H':
- r[1] = +pa[1] + x;
- break;
- case 'M':
- mx = +pa[1] + x;
- my = +pa[2] + y;
- break;
- // for lint
- default:
- for (var j = 1, jj = pa.length; j < jj; j++) {
- r[j] = +pa[j] + (j % 2 ? x : y);
- }
- }
- } else {
- // 如果本来已经大写,则不处理
- r = pathArray[i];
- } // 需要在外面统一做,同时处理 V,H,S,T 等特殊指令
- switch (upCmd) {
- case 'Z':
- x = +mx;
- y = +my;
- break;
- case 'H':
- x = r[1];
- r = ['L', x, y];
- break;
- case 'V':
- y = r[1];
- r = ['L', x, y];
- break;
- case 'T':
- x = r[1];
- y = r[2]; // 以 x, y 为中心的,上一个控制点的对称点
- // 需要假设上一个节点的命令为 Q
- var symetricT = toSymmetry([preParams[1], preParams[2]], [preParams[3], preParams[4]]);
- r = ['Q', symetricT[0], symetricT[1], x, y];
- break;
- case 'S':
- x = r[r.length - 2];
- y = r[r.length - 1]; // 以 x,y 为中心,取上一个控制点,
- // 需要假设上一个线段为 C 或者 S
- var length_1 = preParams.length;
- var symetricS = toSymmetry([preParams[length_1 - 4], preParams[length_1 - 3]], [preParams[length_1 - 2], preParams[length_1 - 1]]);
- r = ['C', symetricS[0], symetricS[1], r[1], r[2], x, y];
- break;
- case 'M':
- mx = r[r.length - 2];
- my = r[r.length - 1];
- break;
- // for lint
- default:
- x = r[r.length - 2];
- y = r[r.length - 1];
- }
- res.push(r);
- }
- return res;
- }
- exports.default = pathToAbsolute;
- /***/ }),
- /***/ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-segments.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-segments.js ***!
- \************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var get_arc_params_1 = __webpack_require__(/*! ./get-arc-params */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/get-arc-params.js");
- var get_arc_params_2 = __webpack_require__(/*! ./get-arc-params */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/get-arc-params.js");
- var parse_path_1 = __webpack_require__(/*! ./parse-path */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/parse-path.js"); // 点对称
- function toSymmetry(point, center) {
- return [center[0] + (center[0] - point[0]), center[1] + (center[1] - point[1])];
- }
- function getSegments(path) {
- path = parse_path_1.default(path);
- var segments = [];
- var currentPoint = null; // 当前图形
- var nextParams = null; // 下一节点的 path 参数
- var startMovePoint = null; // 开始 M 的点,可能会有多个
- var lastStartMovePointIndex = 0; // 最近一个开始点 M 的索引
- var count = path.length;
- for (var i = 0; i < count; i++) {
- var params = path[i];
- nextParams = path[i + 1];
- var command = params[0]; // 数学定义上的参数,便于后面的计算
- var segment = {
- command: command,
- prePoint: currentPoint,
- params: params,
- startTangent: null,
- endTangent: null
- };
- switch (command) {
- case 'M':
- startMovePoint = [params[1], params[2]];
- lastStartMovePointIndex = i;
- break;
- case 'A':
- var arcParams = get_arc_params_1.default(currentPoint, params);
- segment['arcParams'] = arcParams;
- break;
- default:
- break;
- }
- if (command === 'Z') {
- // 有了 Z 后,当前节点从开始 M 的点开始
- currentPoint = startMovePoint; // 如果当前点的命令为 Z,相当于当前点为最近一个 M 点,则下一个点直接指向最近一个 M 点的下一个点
- nextParams = path[lastStartMovePointIndex + 1];
- } else {
- var len = params.length;
- currentPoint = [params[len - 2], params[len - 1]];
- }
- if (nextParams && nextParams[0] === 'Z') {
- // 如果下一个点的命令为 Z,则下一个点直接指向最近一个 M 点
- nextParams = path[lastStartMovePointIndex];
- if (segments[lastStartMovePointIndex]) {
- // 如果下一个点的命令为 Z,则最近一个 M 点的前一个点为当前点
- segments[lastStartMovePointIndex].prePoint = currentPoint;
- }
- }
- segment['currentPoint'] = currentPoint; // 如果当前点与最近一个 M 点相同,则最近一个 M 点的前一个点为当前点的前一个点
- if (segments[lastStartMovePointIndex] && get_arc_params_2.isSamePoint(currentPoint, segments[lastStartMovePointIndex].currentPoint)) {
- segments[lastStartMovePointIndex].prePoint = segment.prePoint;
- }
- var nextPoint = nextParams ? [nextParams[nextParams.length - 2], nextParams[nextParams.length - 1]] : null;
- segment['nextPoint'] = nextPoint; // Add startTangent and endTangent
- var prePoint = segment.prePoint;
- if (['L', 'H', 'V'].includes(command)) {
- segment.startTangent = [prePoint[0] - currentPoint[0], prePoint[1] - currentPoint[1]];
- segment.endTangent = [currentPoint[0] - prePoint[0], currentPoint[1] - prePoint[1]];
- } else if (command === 'Q') {
- // 二次贝塞尔曲线只有一个控制点
- var cp = [params[1], params[2]]; // 二次贝塞尔曲线的终点为 currentPoint
- segment.startTangent = [prePoint[0] - cp[0], prePoint[1] - cp[1]];
- segment.endTangent = [currentPoint[0] - cp[0], currentPoint[1] - cp[1]];
- } else if (command === 'T') {
- var preSegment = segments[i - 1];
- var cp = toSymmetry(preSegment.currentPoint, prePoint);
- if (preSegment.command === 'Q') {
- segment.command = 'Q';
- segment.startTangent = [prePoint[0] - cp[0], prePoint[1] - cp[1]];
- segment.endTangent = [currentPoint[0] - cp[0], currentPoint[1] - cp[1]];
- } else {
- segment.command = 'TL';
- segment.startTangent = [prePoint[0] - currentPoint[0], prePoint[1] - currentPoint[1]];
- segment.endTangent = [currentPoint[0] - prePoint[0], currentPoint[1] - prePoint[1]];
- }
- } else if (command === 'C') {
- // 三次贝塞尔曲线有两个控制点
- var cp1 = [params[1], params[2]];
- var cp2 = [params[3], params[4]];
- segment.startTangent = [prePoint[0] - cp1[0], prePoint[1] - cp1[1]];
- segment.endTangent = [currentPoint[0] - cp2[0], currentPoint[1] - cp2[1]];
- } else if (command === 'S') {
- var preSegment = segments[i - 1];
- var cp1 = toSymmetry(preSegment.currentPoint, prePoint);
- var cp2 = [params[1], params[2]];
- if (preSegment.command === 'C') {
- segment.command = 'C'; // 将 S 命令变换为 C 命令
- segment.startTangent = [prePoint[0] - cp1[0], prePoint[1] - cp1[1]];
- segment.endTangent = [currentPoint[0] - cp2[0], currentPoint[1] - cp2[1]];
- } else {
- segment.command = 'SQ'; // 将 S 命令变换为 SQ 命令
- segment.startTangent = [prePoint[0] - cp2[0], prePoint[1] - cp2[1]];
- segment.endTangent = [currentPoint[0] - cp2[0], currentPoint[1] - cp2[1]];
- }
- } else if (command === 'A') {
- var d = 0.001;
- var _a = segment['arcParams'] || {},
- _b = _a.cx,
- cx = _b === void 0 ? 0 : _b,
- _c = _a.cy,
- cy = _c === void 0 ? 0 : _c,
- _d = _a.rx,
- rx = _d === void 0 ? 0 : _d,
- _e = _a.ry,
- ry = _e === void 0 ? 0 : _e,
- _f = _a.sweepFlag,
- sweepFlag = _f === void 0 ? 0 : _f,
- _g = _a.startAngle,
- startAngle = _g === void 0 ? 0 : _g,
- _h = _a.endAngle,
- endAngle = _h === void 0 ? 0 : _h;
- if (sweepFlag === 0) {
- d *= -1;
- }
- var dx1 = rx * Math.cos(startAngle - d) + cx;
- var dy1 = ry * Math.sin(startAngle - d) + cy;
- segment.startTangent = [dx1 - startMovePoint[0], dy1 - startMovePoint[1]];
- var dx2 = rx * Math.cos(startAngle + endAngle + d) + cx;
- var dy2 = ry * Math.sin(startAngle + endAngle - d) + cy;
- segment.endTangent = [prePoint[0] - dx2, prePoint[1] - dy2];
- }
- segments.push(segment);
- }
- return segments;
- }
- exports.default = getSegments;
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/augment.js":
- /*!******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/augment.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/mix.js");
- /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
- var augment = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- var c = args[0];
- for (var i = 1; i < args.length; i++) {
- var obj = args[i];
- if (Object(_is_function__WEBPACK_IMPORTED_MODULE_1__["default"])(obj)) {
- obj = obj.prototype;
- }
- Object(_mix__WEBPACK_IMPORTED_MODULE_0__["default"])(c.prototype, obj);
- }
- };
- /* harmony default export */ __webpack_exports__["default"] = (augment);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/cache.js":
- /*!****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/cache.js ***!
- \****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * k-v 存储
- */
- var default_1 =
- /** @class */
- function () {
- function default_1() {
- this.map = {};
- }
- default_1.prototype.has = function (key) {
- return this.map[key] !== undefined;
- };
- default_1.prototype.get = function (key, def) {
- var v = this.map[key];
- return v === undefined ? def : v;
- };
- default_1.prototype.set = function (key, value) {
- this.map[key] = value;
- };
- default_1.prototype.clear = function () {
- this.map = {};
- };
- default_1.prototype.delete = function (key) {
- delete this.map[key];
- };
- default_1.prototype.size = function () {
- return Object.keys(this.map).length;
- };
- return default_1;
- }();
- /* harmony default export */ __webpack_exports__["default"] = (default_1);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/clamp.js":
- /*!****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/clamp.js ***!
- \****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var clamp = function (a, min, max) {
- if (a < min) {
- return min;
- } else if (a > max) {
- return max;
- }
- return a;
- };
- /* harmony default export */ __webpack_exports__["default"] = (clamp);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/clear-animation-frame.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/clear-animation-frame.js ***!
- \********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return cancelAnimationFrame; });
- function cancelAnimationFrame(handler) {
- var method = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || // @ts-ignore
- window.mozCancelAnimationFrame || // @ts-ignore
- window.msCancelAnimationFrame || clearTimeout;
- method(handler);
- }
- ;
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/clone.js":
- /*!****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/clone.js ***!
- \****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- var clone = function (obj) {
- if (typeof obj !== 'object' || obj === null) {
- return obj;
- }
- var rst;
- if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(obj)) {
- rst = [];
- for (var i = 0, l = obj.length; i < l; i++) {
- if (typeof obj[i] === 'object' && obj[i] != null) {
- rst[i] = clone(obj[i]);
- } else {
- rst[i] = obj[i];
- }
- }
- } else {
- rst = {};
- for (var k in obj) {
- if (typeof obj[k] === 'object' && obj[k] != null) {
- rst[k] = clone(obj[k]);
- } else {
- rst[k] = obj[k];
- }
- }
- }
- return rst;
- };
- /* harmony default export */ __webpack_exports__["default"] = (clone);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/contains.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/contains.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
- var contains = function (arr, value) {
- if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
- return false;
- }
- return arr.indexOf(value) > -1;
- };
- /* harmony default export */ __webpack_exports__["default"] = (contains);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/debounce.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/debounce.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- function debounce(func, wait, immediate) {
- var timeout;
- return function () {
- var context = this,
- args = arguments;
- var later = function () {
- timeout = null;
- if (!immediate) {
- func.apply(context, args);
- }
- };
- var callNow = immediate && !timeout;
- clearTimeout(timeout);
- timeout = setTimeout(later, wait);
- if (callNow) {
- func.apply(context, args);
- }
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (debounce);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/deep-mix.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/deep-mix.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- /* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-plain-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-plain-object.js");
- var MAX_MIX_LEVEL = 5;
- function _deepMix(dist, src, level, maxLevel) {
- level = level || 0;
- maxLevel = maxLevel || MAX_MIX_LEVEL;
- for (var key in src) {
- if (src.hasOwnProperty(key)) {
- var value = src[key];
- if (value !== null && Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
- if (!Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_1__["default"])(dist[key])) {
- dist[key] = {};
- }
- if (level < maxLevel) {
- _deepMix(dist[key], value, level + 1, maxLevel);
- } else {
- dist[key] = src[key];
- }
- } else if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
- dist[key] = [];
- dist[key] = dist[key].concat(value);
- } else if (value !== undefined) {
- dist[key] = value;
- }
- }
- }
- } // todo 重写
- var deepMix = function (rst) {
- var args = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- args[_i - 1] = arguments[_i];
- }
- for (var i = 0; i < args.length; i += 1) {
- _deepMix(rst, args[i]);
- }
- return rst;
- };
- /* harmony default export */ __webpack_exports__["default"] = (deepMix);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/difference.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/difference.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filter */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/filter.js");
- /* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contains */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/contains.js");
- /**
- * Flattens `array` a single level deep.
- *
- * @param {Array} arr The array to inspect.
- * @param {Array} values The values to exclude.
- * @return {Array} Returns the new array of filtered values.
- * @example
- * difference([2, 1], [2, 3]); // => [1]
- */
- var difference = function (arr, values) {
- if (values === void 0) {
- values = [];
- }
- return Object(_filter__WEBPACK_IMPORTED_MODULE_0__["default"])(arr, function (value) {
- return !Object(_contains__WEBPACK_IMPORTED_MODULE_1__["default"])(values, value);
- });
- };
- /* harmony default export */ __webpack_exports__["default"] = (difference);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js":
- /*!***************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- /* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object.js");
- function each(elements, func) {
- if (!elements) {
- return;
- }
- var rst;
- if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(elements)) {
- for (var i = 0, len = elements.length; i < len; i++) {
- rst = func(elements[i], i);
- if (rst === false) {
- break;
- }
- }
- } else if (Object(_is_object__WEBPACK_IMPORTED_MODULE_1__["default"])(elements)) {
- for (var k in elements) {
- if (elements.hasOwnProperty(k)) {
- rst = func(elements[k], k);
- if (rst === false) {
- break;
- }
- }
- }
- }
- }
- /* harmony default export */ __webpack_exports__["default"] = (each);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/ends-with.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/ends-with.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- /* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js");
- function endsWith(arr, e) {
- return Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || Object(_is_string__WEBPACK_IMPORTED_MODULE_1__["default"])(arr) ? arr[arr.length - 1] === e : false;
- }
- /* harmony default export */ __webpack_exports__["default"] = (endsWith);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/every.js":
- /*!****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/every.js ***!
- \****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * 只要有一个不满足条件就返回 false
- * @param arr
- * @param func
- */
- var every = function (arr, func) {
- for (var i = 0; i < arr.length; i++) {
- if (!func(arr[i], i)) return false;
- }
- return true;
- };
- /* harmony default export */ __webpack_exports__["default"] = (every);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/extend.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/extend.js ***!
- \*****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/mix.js");
- /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
- var extend = function (subclass, superclass, overrides, staticOverrides) {
- // 如果只提供父类构造函数,则自动生成子类构造函数
- if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_1__["default"])(superclass)) {
- overrides = superclass;
- superclass = subclass;
- subclass = function () {};
- }
- var create = Object.create ? function (proto, c) {
- return Object.create(proto, {
- constructor: {
- value: c
- }
- });
- } : function (proto, c) {
- function Tmp() {}
- Tmp.prototype = proto;
- var o = new Tmp();
- o.constructor = c;
- return o;
- };
- var superObj = create(superclass.prototype, subclass); // new superclass(),//实例化父类作为子类的prototype
- subclass.prototype = Object(_mix__WEBPACK_IMPORTED_MODULE_0__["default"])(superObj, subclass.prototype); // 指定子类的prototype
- subclass.superclass = create(superclass.prototype, superclass);
- Object(_mix__WEBPACK_IMPORTED_MODULE_0__["default"])(superObj, overrides);
- Object(_mix__WEBPACK_IMPORTED_MODULE_0__["default"])(subclass, staticOverrides);
- return subclass;
- };
- /* harmony default export */ __webpack_exports__["default"] = (extend);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/filter.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/filter.js ***!
- \*****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
- var filter = function (arr, func) {
- if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
- return arr;
- }
- var result = [];
- for (var index = 0; index < arr.length; index++) {
- var value = arr[index];
- if (func(value, index)) {
- result.push(value);
- }
- }
- return result;
- };
- /* harmony default export */ __webpack_exports__["default"] = (filter);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/find-index.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/find-index.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- function findIndex(arr, predicate, fromIndex) {
- if (fromIndex === void 0) {
- fromIndex = 0;
- }
- for (var i = fromIndex; i < arr.length; i++) {
- if (predicate(arr[i], i)) {
- // 找到终止循环
- return i;
- }
- }
- return -1;
- }
- /* harmony default export */ __webpack_exports__["default"] = (findIndex);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/find.js":
- /*!***************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/find.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
- /* harmony import */ var _is_match__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-match */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-match.js");
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- /* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./is-plain-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-plain-object.js");
- function find(arr, predicate) {
- if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_2__["default"])(arr)) return null;
- var _predicate;
- if (Object(_is_function__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate)) {
- _predicate = predicate;
- }
- if (Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_3__["default"])(predicate)) {
- _predicate = function (a) {
- return Object(_is_match__WEBPACK_IMPORTED_MODULE_1__["default"])(a, predicate);
- };
- }
- if (_predicate) {
- for (var i = 0; i < arr.length; i += 1) {
- if (_predicate(arr[i])) {
- return arr[i];
- }
- }
- }
- return null;
- }
- /* harmony default export */ __webpack_exports__["default"] = (find);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/first-value.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/first-value.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- var firstValue = function (data, name) {
- var rst = null;
- for (var i = 0; i < data.length; i++) {
- var obj = data[i];
- var value = obj[name];
- if (!Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
- if (Object(_is_array__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
- rst = value[0]; // todo 这里是否应该使用递归,调用 firstValue @绝云
- } else {
- rst = value;
- }
- break;
- }
- }
- return rst;
- };
- /* harmony default export */ __webpack_exports__["default"] = (firstValue);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/fixed-base.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/fixed-base.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var fixedBase = function (v, base) {
- var str = base.toString();
- var index = str.indexOf('.');
- if (index === -1) {
- return Math.round(v);
- }
- var length = str.substr(index + 1).length;
- if (length > 20) {
- length = 20;
- }
- return parseFloat(v.toFixed(length));
- };
- /* harmony default export */ __webpack_exports__["default"] = (fixedBase);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/flatten-deep.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/flatten-deep.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- /**
- * Flattens `array` a single level deep.
- *
- * @param {Array} arr The array to flatten.
- * @param {Array} result The array to return.
- * @return {Array} Returns the new flattened array.
- * @example
- *
- * flattenDeep([1, [2, [3, [4]], 5]]); // => [1, 2, 3, 4, 5]
- */
- var flattenDeep = function (arr, result) {
- if (result === void 0) {
- result = [];
- }
- if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
- result.push(arr);
- } else {
- for (var i = 0; i < arr.length; i += 1) {
- flattenDeep(arr[i], result);
- }
- }
- return result;
- };
- /* harmony default export */ __webpack_exports__["default"] = (flattenDeep);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/flatten.js":
- /*!******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/flatten.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- /**
- * Flattens `array` a single level deep.
- *
- * @param {Array} arr The array to flatten.
- * @return {Array} Returns the new flattened array.
- * @example
- *
- * flatten([1, [2, [3, [4]], 5]]); // => [1, 2, [3, [4]], 5]
- */
- var flatten = function (arr) {
- if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
- return [];
- }
- var rst = [];
- for (var i = 0; i < arr.length; i++) {
- rst = rst.concat(arr[i]);
- }
- return rst;
- };
- /* harmony default export */ __webpack_exports__["default"] = (flatten);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/for-in.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/for-in.js ***!
- \*****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
- /* harmony default export */ __webpack_exports__["default"] = (_each__WEBPACK_IMPORTED_MODULE_0__["default"]);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-range.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-range.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- var getRange = function (values) {
- // 存在 NaN 时,min,max 判定会出问题
- var filterValues = values.filter(function (v) {
- return !isNaN(v);
- });
- if (!filterValues.length) {
- // 如果没有数值则直接返回0
- return {
- min: 0,
- max: 0
- };
- }
- if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(values[0])) {
- var tmp = [];
- for (var i = 0; i < values.length; i++) {
- tmp = tmp.concat(values[i]);
- }
- filterValues = tmp;
- }
- var max = Math.max.apply(null, filterValues);
- var min = Math.min.apply(null, filterValues);
- return {
- min: min,
- max: max
- };
- };
- /* harmony default export */ __webpack_exports__["default"] = (getRange);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-type.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-type.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var toString = {}.toString;
- var getType = function (value) {
- return toString.call(value).replace(/^\[object /, '').replace(/]$/, '');
- };
- /* harmony default export */ __webpack_exports__["default"] = (getType);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-wrap-behavior.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-wrap-behavior.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * 获取封装的事件
- * @protected
- * @param {Object} obj 对象
- * @param {String} action 事件名称
- * @return {Function} 返回事件处理函数
- */
- function getWrapBehavior(obj, action) {
- return obj['_wrap_' + action];
- }
- /* harmony default export */ __webpack_exports__["default"] = (getWrapBehavior);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get.js":
- /*!**************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/get.js ***!
- \**************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js");
- /**
- * https://github.com/developit/dlv/blob/master/index.js
- * @param obj
- * @param key
- * @param defaultValue
- */
- /* harmony default export */ __webpack_exports__["default"] = (function (obj, key, defaultValue) {
- var p = 0;
- var keyArr = Object(_is_string__WEBPACK_IMPORTED_MODULE_0__["default"])(key) ? key.split('.') : key;
- while (obj && p < keyArr.length) {
- obj = obj[keyArr[p++]];
- }
- return obj === undefined || p < keyArr.length ? defaultValue : obj;
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-by.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-by.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function groupBy(data, condition) {
- if (!condition || !Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(data)) {
- return {};
- }
- var result = {}; // 兼容方法和 字符串的写法
- var predicate = Object(_is_function__WEBPACK_IMPORTED_MODULE_1__["default"])(condition) ? condition : function (item) {
- return item[condition];
- };
- var key;
- for (var i = 0; i < data.length; i++) {
- var item = data[i];
- key = predicate(item);
- if (hasOwnProperty.call(result, key)) {
- result[key].push(item);
- } else {
- result[key] = [item];
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (groupBy);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-to-map.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-to-map.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
- /* harmony import */ var _group_by__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./group-by */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-by.js");
- var groupToMap = function (data, condition) {
- if (!condition) {
- return {
- 0: data
- };
- }
- if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_1__["default"])(condition)) {
- var paramsCondition_1 = Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(condition) ? condition : condition.replace(/\s+/g, '').split('*');
- condition = function (row) {
- var unique = '_'; // 避免出现数字作为Key的情况,会进行按照数字的排序
- for (var i = 0, l = paramsCondition_1.length; i < l; i++) {
- unique += row[paramsCondition_1[i]] && row[paramsCondition_1[i]].toString();
- }
- return unique;
- };
- }
- var groups = Object(_group_by__WEBPACK_IMPORTED_MODULE_2__["default"])(data, condition);
- return groups;
- };
- /* harmony default export */ __webpack_exports__["default"] = (groupToMap);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group.js":
- /*!****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/group.js ***!
- \****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _group_to_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./group-to-map */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-to-map.js");
- /* harmony default export */ __webpack_exports__["default"] = (function (data, condition) {
- if (!condition) {
- // 没有条件,则自身改成数组
- return [data];
- }
- var groups = Object(_group_to_map__WEBPACK_IMPORTED_MODULE_0__["default"])(data, condition);
- var array = [];
- for (var i in groups) {
- array.push(groups[i]);
- }
- return array;
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/has-key.js":
- /*!******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/has-key.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _has__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./has */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/has.js");
- /* harmony default export */ __webpack_exports__["default"] = (_has__WEBPACK_IMPORTED_MODULE_0__["default"]);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/has-value.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/has-value.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contains */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/contains.js");
- /* harmony import */ var _values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/values.js");
- /* harmony default export */ __webpack_exports__["default"] = (function (obj, value) {
- return Object(_contains__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_values__WEBPACK_IMPORTED_MODULE_1__["default"])(obj), value);
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/has.js":
- /*!**************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/has.js ***!
- \**************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = (function (obj, key) {
- return obj.hasOwnProperty(key);
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/head.js":
- /*!***************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/head.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return head; });
- /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
- function head(o) {
- if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(o)) {
- return o[0];
- }
- return undefined;
- }
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/identity.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/identity.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = (function (v) {
- return v;
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index-of.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/index-of.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
- var indexOf = function (arr, obj) {
- if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
- return -1;
- }
- var m = Array.prototype.indexOf;
- if (m) {
- return m.call(arr, obj);
- }
- var index = -1;
- for (var i = 0; i < arr.length; i++) {
- if (arr[i] === obj) {
- index = i;
- break;
- }
- }
- return index;
- };
- /* harmony default export */ __webpack_exports__["default"] = (indexOf);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js":
- /*!****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js ***!
- \****************************************************************/
- /*! exports provided: contains, includes, difference, find, findIndex, firstValue, flatten, flattenDeep, getRange, pull, pullAt, reduce, remove, sortBy, union, uniq, valuesOfKey, head, last, startsWith, endsWith, filter, every, some, group, groupBy, groupToMap, getWrapBehavior, wrapBehavior, number2color, parseRadius, clamp, fixedBase, isDecimal, isEven, isInteger, isNegative, isNumberEqual, isOdd, isPositive, maxBy, minBy, mod, toDegree, toInteger, toRadian, forIn, has, hasKey, hasValue, keys, isMatch, values, lowerCase, lowerFirst, substitute, upperCase, upperFirst, getType, isArguments, isArray, isArrayLike, isBoolean, isDate, isError, isFunction, isFinite, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPrototype, isRegExp, isString, isType, isUndefined, isElement, requestAnimationFrame, clearAnimationFrame, augment, clone, debounce, memoize, deepMix, each, extend, indexOf, isEmpty, isEqual, isEqualWith, map, mapValues, mix, assign, get, set, pick, throttle, toArray, toString, uniqueId, noop, identity, size, Cache */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contains */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/contains.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return _contains__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return _contains__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _difference__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./difference */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/difference.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return _difference__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _find__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./find */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/find.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _find__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _find_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./find-index */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/find-index.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _find_index__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _first_value__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./first-value */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/first-value.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "firstValue", function() { return _first_value__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _flatten__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./flatten */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/flatten.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return _flatten__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _flatten_deep__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flatten-deep */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/flatten-deep.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDeep", function() { return _flatten_deep__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _get_range__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./get-range */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-range.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getRange", function() { return _get_range__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _pull__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./pull */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/pull.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pull", function() { return _pull__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _pull_at__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pull-at */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/pull-at.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAt", function() { return _pull_at__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./reduce */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/reduce.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _reduce__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _remove__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./remove */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/remove.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return _remove__WEBPACK_IMPORTED_MODULE_11__["default"]; });
- /* harmony import */ var _sort_by__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./sort-by */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/sort-by.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return _sort_by__WEBPACK_IMPORTED_MODULE_12__["default"]; });
- /* harmony import */ var _union__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./union */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/union.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "union", function() { return _union__WEBPACK_IMPORTED_MODULE_13__["default"]; });
- /* harmony import */ var _uniq__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./uniq */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/uniq.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return _uniq__WEBPACK_IMPORTED_MODULE_14__["default"]; });
- /* harmony import */ var _values_of_key__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./values-of-key */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/values-of-key.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valuesOfKey", function() { return _values_of_key__WEBPACK_IMPORTED_MODULE_15__["default"]; });
- /* harmony import */ var _head__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./head */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/head.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "head", function() { return _head__WEBPACK_IMPORTED_MODULE_16__["default"]; });
- /* harmony import */ var _last__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./last */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/last.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _last__WEBPACK_IMPORTED_MODULE_17__["default"]; });
- /* harmony import */ var _starts_with__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./starts-with */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/starts-with.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return _starts_with__WEBPACK_IMPORTED_MODULE_18__["default"]; });
- /* harmony import */ var _ends_with__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./ends-with */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/ends-with.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return _ends_with__WEBPACK_IMPORTED_MODULE_19__["default"]; });
- /* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./filter */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/filter.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _filter__WEBPACK_IMPORTED_MODULE_20__["default"]; });
- /* harmony import */ var _every__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./every */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/every.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _every__WEBPACK_IMPORTED_MODULE_21__["default"]; });
- /* harmony import */ var _some__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./some */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/some.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "some", function() { return _some__WEBPACK_IMPORTED_MODULE_22__["default"]; });
- /* harmony import */ var _group__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./group */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "group", function() { return _group__WEBPACK_IMPORTED_MODULE_23__["default"]; });
- /* harmony import */ var _group_by__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./group-by */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-by.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _group_by__WEBPACK_IMPORTED_MODULE_24__["default"]; });
- /* harmony import */ var _group_to_map__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./group-to-map */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-to-map.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupToMap", function() { return _group_to_map__WEBPACK_IMPORTED_MODULE_25__["default"]; });
- /* harmony import */ var _get_wrap_behavior__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./get-wrap-behavior */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-wrap-behavior.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getWrapBehavior", function() { return _get_wrap_behavior__WEBPACK_IMPORTED_MODULE_26__["default"]; });
- /* harmony import */ var _wrap_behavior__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./wrap-behavior */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/wrap-behavior.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapBehavior", function() { return _wrap_behavior__WEBPACK_IMPORTED_MODULE_27__["default"]; });
- /* harmony import */ var _number2color__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./number2color */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/number2color.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "number2color", function() { return _number2color__WEBPACK_IMPORTED_MODULE_28__["default"]; });
- /* harmony import */ var _parse_radius__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./parse-radius */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/parse-radius.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseRadius", function() { return _parse_radius__WEBPACK_IMPORTED_MODULE_29__["default"]; });
- /* harmony import */ var _clamp__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./clamp */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/clamp.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return _clamp__WEBPACK_IMPORTED_MODULE_30__["default"]; });
- /* harmony import */ var _fixed_base__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./fixed-base */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/fixed-base.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fixedBase", function() { return _fixed_base__WEBPACK_IMPORTED_MODULE_31__["default"]; });
- /* harmony import */ var _is_decimal__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./is-decimal */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-decimal.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDecimal", function() { return _is_decimal__WEBPACK_IMPORTED_MODULE_32__["default"]; });
- /* harmony import */ var _is_even__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./is-even */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-even.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEven", function() { return _is_even__WEBPACK_IMPORTED_MODULE_33__["default"]; });
- /* harmony import */ var _is_integer__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./is-integer */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-integer.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isInteger", function() { return _is_integer__WEBPACK_IMPORTED_MODULE_34__["default"]; });
- /* harmony import */ var _is_negative__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./is-negative */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-negative.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNegative", function() { return _is_negative__WEBPACK_IMPORTED_MODULE_35__["default"]; });
- /* harmony import */ var _is_number_equal__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./is-number-equal */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number-equal.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNumberEqual", function() { return _is_number_equal__WEBPACK_IMPORTED_MODULE_36__["default"]; });
- /* harmony import */ var _is_odd__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./is-odd */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-odd.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isOdd", function() { return _is_odd__WEBPACK_IMPORTED_MODULE_37__["default"]; });
- /* harmony import */ var _is_positive__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./is-positive */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-positive.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPositive", function() { return _is_positive__WEBPACK_IMPORTED_MODULE_38__["default"]; });
- /* harmony import */ var _max_by__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./max-by */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/max-by.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maxBy", function() { return _max_by__WEBPACK_IMPORTED_MODULE_39__["default"]; });
- /* harmony import */ var _min_by__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./min-by */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/min-by.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "minBy", function() { return _min_by__WEBPACK_IMPORTED_MODULE_40__["default"]; });
- /* harmony import */ var _mod__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./mod */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/mod.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mod", function() { return _mod__WEBPACK_IMPORTED_MODULE_41__["default"]; });
- /* harmony import */ var _to_degree__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./to-degree */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-degree.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toDegree", function() { return _to_degree__WEBPACK_IMPORTED_MODULE_42__["default"]; });
- /* harmony import */ var _to_integer__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./to-integer */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-integer.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toInteger", function() { return _to_integer__WEBPACK_IMPORTED_MODULE_43__["default"]; });
- /* harmony import */ var _to_radian__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./to-radian */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-radian.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toRadian", function() { return _to_radian__WEBPACK_IMPORTED_MODULE_44__["default"]; });
- /* harmony import */ var _for_in__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./for-in */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/for-in.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forIn", function() { return _for_in__WEBPACK_IMPORTED_MODULE_45__["default"]; });
- /* harmony import */ var _has__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./has */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/has.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "has", function() { return _has__WEBPACK_IMPORTED_MODULE_46__["default"]; });
- /* harmony import */ var _has_key__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./has-key */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/has-key.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hasKey", function() { return _has_key__WEBPACK_IMPORTED_MODULE_47__["default"]; });
- /* harmony import */ var _has_value__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./has-value */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/has-value.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hasValue", function() { return _has_value__WEBPACK_IMPORTED_MODULE_48__["default"]; });
- /* harmony import */ var _keys__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./keys */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/keys.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return _keys__WEBPACK_IMPORTED_MODULE_49__["default"]; });
- /* harmony import */ var _is_match__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./is-match */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-match.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return _is_match__WEBPACK_IMPORTED_MODULE_50__["default"]; });
- /* harmony import */ var _values__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./values */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/values.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "values", function() { return _values__WEBPACK_IMPORTED_MODULE_51__["default"]; });
- /* harmony import */ var _lower_case__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./lower-case */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/lower-case.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerCase", function() { return _lower_case__WEBPACK_IMPORTED_MODULE_52__["default"]; });
- /* harmony import */ var _lower_first__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./lower-first */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/lower-first.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerFirst", function() { return _lower_first__WEBPACK_IMPORTED_MODULE_53__["default"]; });
- /* harmony import */ var _substitute__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./substitute */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/substitute.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "substitute", function() { return _substitute__WEBPACK_IMPORTED_MODULE_54__["default"]; });
- /* harmony import */ var _upper_case__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./upper-case */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/upper-case.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperCase", function() { return _upper_case__WEBPACK_IMPORTED_MODULE_55__["default"]; });
- /* harmony import */ var _upper_first__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./upper-first */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/upper-first.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperFirst", function() { return _upper_first__WEBPACK_IMPORTED_MODULE_56__["default"]; });
- /* harmony import */ var _get_type__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./get-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-type.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getType", function() { return _get_type__WEBPACK_IMPORTED_MODULE_57__["default"]; });
- /* harmony import */ var _is_arguments__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./is-arguments */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-arguments.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return _is_arguments__WEBPACK_IMPORTED_MODULE_58__["default"]; });
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return _is_array__WEBPACK_IMPORTED_MODULE_59__["default"]; });
- /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return _is_array_like__WEBPACK_IMPORTED_MODULE_60__["default"]; });
- /* harmony import */ var _is_boolean__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./is-boolean */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-boolean.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return _is_boolean__WEBPACK_IMPORTED_MODULE_61__["default"]; });
- /* harmony import */ var _is_date__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./is-date */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-date.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return _is_date__WEBPACK_IMPORTED_MODULE_62__["default"]; });
- /* harmony import */ var _is_error__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./is-error */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-error.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return _is_error__WEBPACK_IMPORTED_MODULE_63__["default"]; });
- /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return _is_function__WEBPACK_IMPORTED_MODULE_64__["default"]; });
- /* harmony import */ var _is_finite__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./is-finite */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-finite.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return _is_finite__WEBPACK_IMPORTED_MODULE_65__["default"]; });
- /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNil", function() { return _is_nil__WEBPACK_IMPORTED_MODULE_66__["default"]; });
- /* harmony import */ var _is_null__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./is-null */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-null.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return _is_null__WEBPACK_IMPORTED_MODULE_67__["default"]; });
- /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return _is_number__WEBPACK_IMPORTED_MODULE_68__["default"]; });
- /* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return _is_object__WEBPACK_IMPORTED_MODULE_69__["default"]; });
- /* harmony import */ var _is_object_like__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./is-object-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object-like.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObjectLike", function() { return _is_object_like__WEBPACK_IMPORTED_MODULE_70__["default"]; });
- /* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./is-plain-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-plain-object.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return _is_plain_object__WEBPACK_IMPORTED_MODULE_71__["default"]; });
- /* harmony import */ var _is_prototype__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./is-prototype */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-prototype.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPrototype", function() { return _is_prototype__WEBPACK_IMPORTED_MODULE_72__["default"]; });
- /* harmony import */ var _is_reg_exp__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./is-reg-exp */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-reg-exp.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return _is_reg_exp__WEBPACK_IMPORTED_MODULE_73__["default"]; });
- /* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _is_string__WEBPACK_IMPORTED_MODULE_74__["default"]; });
- /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isType", function() { return _is_type__WEBPACK_IMPORTED_MODULE_75__["default"]; });
- /* harmony import */ var _is_undefined__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./is-undefined */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-undefined.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return _is_undefined__WEBPACK_IMPORTED_MODULE_76__["default"]; });
- /* harmony import */ var _is_element__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./is-element */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-element.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return _is_element__WEBPACK_IMPORTED_MODULE_77__["default"]; });
- /* harmony import */ var _request_animation_frame__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./request-animation-frame */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/request-animation-frame.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "requestAnimationFrame", function() { return _request_animation_frame__WEBPACK_IMPORTED_MODULE_78__["default"]; });
- /* harmony import */ var _clear_animation_frame__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./clear-animation-frame */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/clear-animation-frame.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clearAnimationFrame", function() { return _clear_animation_frame__WEBPACK_IMPORTED_MODULE_79__["default"]; });
- /* harmony import */ var _augment__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./augment */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/augment.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "augment", function() { return _augment__WEBPACK_IMPORTED_MODULE_80__["default"]; });
- /* harmony import */ var _clone__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./clone */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/clone.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return _clone__WEBPACK_IMPORTED_MODULE_81__["default"]; });
- /* harmony import */ var _debounce__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ./debounce */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/debounce.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _debounce__WEBPACK_IMPORTED_MODULE_82__["default"]; });
- /* harmony import */ var _memoize__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./memoize */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/memoize.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return _memoize__WEBPACK_IMPORTED_MODULE_83__["default"]; });
- /* harmony import */ var _deep_mix__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./deep-mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/deep-mix.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "deepMix", function() { return _deep_mix__WEBPACK_IMPORTED_MODULE_84__["default"]; });
- /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "each", function() { return _each__WEBPACK_IMPORTED_MODULE_85__["default"]; });
- /* harmony import */ var _extend__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./extend */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/extend.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return _extend__WEBPACK_IMPORTED_MODULE_86__["default"]; });
- /* harmony import */ var _index_of__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./index-of */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index-of.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return _index_of__WEBPACK_IMPORTED_MODULE_87__["default"]; });
- /* harmony import */ var _is_empty__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./is-empty */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-empty.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _is_empty__WEBPACK_IMPORTED_MODULE_88__["default"]; });
- /* harmony import */ var _is_equal__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./is-equal */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-equal.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return _is_equal__WEBPACK_IMPORTED_MODULE_89__["default"]; });
- /* harmony import */ var _is_equal_with__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ./is-equal-with */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-equal-with.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqualWith", function() { return _is_equal_with__WEBPACK_IMPORTED_MODULE_90__["default"]; });
- /* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ./map */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/map.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _map__WEBPACK_IMPORTED_MODULE_91__["default"]; });
- /* harmony import */ var _map_values__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ./map-values */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/map-values.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapValues", function() { return _map_values__WEBPACK_IMPORTED_MODULE_92__["default"]; });
- /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ./mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/mix.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mix", function() { return _mix__WEBPACK_IMPORTED_MODULE_93__["default"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return _mix__WEBPACK_IMPORTED_MODULE_93__["default"]; });
- /* harmony import */ var _get__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ./get */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "get", function() { return _get__WEBPACK_IMPORTED_MODULE_94__["default"]; });
- /* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ./set */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/set.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "set", function() { return _set__WEBPACK_IMPORTED_MODULE_95__["default"]; });
- /* harmony import */ var _pick__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ./pick */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/pick.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return _pick__WEBPACK_IMPORTED_MODULE_96__["default"]; });
- /* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ./throttle */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/throttle.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _throttle__WEBPACK_IMPORTED_MODULE_97__["default"]; });
- /* harmony import */ var _to_array__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ./to-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-array.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _to_array__WEBPACK_IMPORTED_MODULE_98__["default"]; });
- /* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-string.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return _to_string__WEBPACK_IMPORTED_MODULE_99__["default"]; });
- /* harmony import */ var _unique_id__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ./unique-id */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/unique-id.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return _unique_id__WEBPACK_IMPORTED_MODULE_100__["default"]; });
- /* harmony import */ var _noop__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ./noop */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/noop.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return _noop__WEBPACK_IMPORTED_MODULE_101__["default"]; });
- /* harmony import */ var _identity__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(/*! ./identity */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/identity.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return _identity__WEBPACK_IMPORTED_MODULE_102__["default"]; });
- /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(/*! ./size */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/size.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "size", function() { return _size__WEBPACK_IMPORTED_MODULE_103__["default"]; });
- /* harmony import */ var _cache__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(/*! ./cache */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/cache.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Cache", function() { return _cache__WEBPACK_IMPORTED_MODULE_104__["default"]; });
- // array
- // event
- // format
- // math
- // object
- // string
- // type
- // other
- // 不知道为什么,需要把这个 export,不然 ts 会报类型错误
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-arguments.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-arguments.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
- /**
- * 是否是参数类型
- *
- * @param {Object} value 测试的值
- * @return {Boolean}
- */
- var isArguments = function (value) {
- return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(value, 'Arguments');
- };
- /* harmony default export */ __webpack_exports__["default"] = (isArguments);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js":
- /*!************************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var isArrayLike = function (value) {
- /**
- * isArrayLike([1, 2, 3]) => true
- * isArrayLike(document.body.children) => true
- * isArrayLike('abc') => true
- * isArrayLike(Function) => false
- */
- return value !== null && typeof value !== 'function' && isFinite(value.length);
- };
- /* harmony default export */ __webpack_exports__["default"] = (isArrayLike);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
- /* harmony default export */ __webpack_exports__["default"] = (function (value) {
- return Array.isArray ? Array.isArray(value) : Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(value, 'Array');
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-boolean.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-boolean.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
- /**
- * 是否是布尔类型
- *
- * @param {Object} value 测试的值
- * @return {Boolean}
- */
- var isBoolean = function (value) {
- return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(value, 'Boolean');
- };
- /* harmony default export */ __webpack_exports__["default"] = (isBoolean);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-date.js":
- /*!******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-date.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
- var isDate = function (value) {
- return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(value, 'Date');
- };
- /* harmony default export */ __webpack_exports__["default"] = (isDate);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-decimal.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-decimal.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
- var isDecimal = function (num) {
- return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__["default"])(num) && num % 1 !== 0;
- };
- /* harmony default export */ __webpack_exports__["default"] = (isDecimal);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-element.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-element.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * 判断是否HTML元素
- * @return {Boolean} 是否HTML元素
- */
- var isElement = function (o) {
- return o instanceof Element || o instanceof HTMLDocument;
- };
- /* harmony default export */ __webpack_exports__["default"] = (isElement);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-empty.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-empty.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
- /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
- /* harmony import */ var _get_type__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./get-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-type.js");
- /* harmony import */ var _is_prototype__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./is-prototype */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-prototype.js");
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function isEmpty(value) {
- /**
- * isEmpty(null) => true
- * isEmpty() => true
- * isEmpty(true) => true
- * isEmpty(1) => true
- * isEmpty([1, 2, 3]) => false
- * isEmpty('abc') => false
- * isEmpty({ a: 1 }) => false
- */
- if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
- return true;
- }
- if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
- return !value.length;
- }
- var type = Object(_get_type__WEBPACK_IMPORTED_MODULE_2__["default"])(value);
- if (type === 'Map' || type === 'Set') {
- return !value.size;
- }
- if (Object(_is_prototype__WEBPACK_IMPORTED_MODULE_3__["default"])(value)) {
- return !Object.keys(value).length;
- }
- for (var key in value) {
- if (hasOwnProperty.call(value, key)) {
- return false;
- }
- }
- return true;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isEmpty);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-equal-with.js":
- /*!************************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-equal-with.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
- /* harmony import */ var _is_equal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-equal */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-equal.js");
- /**
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @param {Function} [fn] The function to customize comparisons.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * function isGreeting(value) {
- * return /^h(?:i|ello)$/.test(value);
- * }
- *
- * function customizer(objValue, othValue) {
- * if (isGreeting(objValue) && isGreeting(othValue)) {
- * return true;
- * }
- * }
- *
- * var array = ['hello', 'goodbye'];
- * var other = ['hi', 'goodbye'];
- *
- * isEqualWith(array, other, customizer); // => true
- */
- /* harmony default export */ __webpack_exports__["default"] = (function (value, other, fn) {
- if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_0__["default"])(fn)) {
- return Object(_is_equal__WEBPACK_IMPORTED_MODULE_1__["default"])(value, other);
- }
- return !!fn(value, other);
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-equal.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-equal.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_object_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object-like.js");
- /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
- /* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js");
- var isEqual = function (value, other) {
- if (value === other) {
- return true;
- }
- if (!value || !other) {
- return false;
- }
- if (Object(_is_string__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_is_string__WEBPACK_IMPORTED_MODULE_2__["default"])(other)) {
- return false;
- }
- if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__["default"])(value) || Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__["default"])(other)) {
- if (value.length !== other.length) {
- return false;
- }
- var rst = true;
- for (var i = 0; i < value.length; i++) {
- rst = isEqual(value[i], other[i]);
- if (!rst) {
- break;
- }
- }
- return rst;
- }
- if (Object(_is_object_like__WEBPACK_IMPORTED_MODULE_0__["default"])(value) || Object(_is_object_like__WEBPACK_IMPORTED_MODULE_0__["default"])(other)) {
- var valueKeys = Object.keys(value);
- var otherKeys = Object.keys(other);
- if (valueKeys.length !== otherKeys.length) {
- return false;
- }
- var rst = true;
- for (var i = 0; i < valueKeys.length; i++) {
- rst = isEqual(value[valueKeys[i]], other[valueKeys[i]]);
- if (!rst) {
- break;
- }
- }
- return rst;
- }
- return false;
- };
- /* harmony default export */ __webpack_exports__["default"] = (isEqual);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-error.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-error.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
- /**
- * 是否是参数类型
- *
- * @param {Object} value 测试的值
- * @return {Boolean}
- */
- var isError = function (value) {
- return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(value, 'Error');
- };
- /* harmony default export */ __webpack_exports__["default"] = (isError);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-even.js":
- /*!******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-even.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
- var isEven = function (num) {
- return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__["default"])(num) && num % 2 === 0;
- };
- /* harmony default export */ __webpack_exports__["default"] = (isEven);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-finite.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-finite.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
- /**
- * 判断是否为有限数
- * @return {Boolean}
- */
- /* harmony default export */ __webpack_exports__["default"] = (function (value) {
- return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && isFinite(value);
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
- /**
- * 是否为函数
- * @param {*} fn 对象
- * @return {Boolean} 是否函数
- */
- /* harmony default export */ __webpack_exports__["default"] = (function (value) {
- return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(value, 'Function');
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-integer.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-integer.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
- var isInteger = Number.isInteger ? Number.isInteger : function (num) {
- return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__["default"])(num) && num % 1 === 0;
- };
- /* harmony default export */ __webpack_exports__["default"] = (isInteger);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-match.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-match.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
- /* harmony import */ var _keys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/keys.js");
- function isMatch(obj, attrs) {
- var _keys = Object(_keys__WEBPACK_IMPORTED_MODULE_1__["default"])(attrs);
- var length = _keys.length;
- if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__["default"])(obj)) return !length;
- for (var i = 0; i < length; i += 1) {
- var key = _keys[i];
- if (attrs[key] !== obj[key] || !(key in obj)) {
- return false;
- }
- }
- return true;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isMatch);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-negative.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-negative.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
- var isNegative = function (num) {
- return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__["default"])(num) && num < 0;
- };
- /* harmony default export */ __webpack_exports__["default"] = (isNegative);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js ***!
- \*****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- // isFinite,
- var isNil = function (value) {
- /**
- * isNil(null) => true
- * isNil() => true
- */
- return value === null || value === undefined;
- };
- /* harmony default export */ __webpack_exports__["default"] = (isNil);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-null.js":
- /*!******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-null.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var isNull = function (value) {
- return value === null;
- };
- /* harmony default export */ __webpack_exports__["default"] = (isNull);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number-equal.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number-equal.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isNumberEqual; });
- var PRECISION = 0.00001; // numbers less than this is considered as 0
- function isNumberEqual(a, b, precision) {
- if (precision === void 0) {
- precision = PRECISION;
- }
- return Math.abs(a - b) < precision;
- }
- ;
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
- /**
- * 判断是否数字
- * @return {Boolean} 是否数字
- */
- var isNumber = function (value) {
- return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(value, 'Number');
- };
- /* harmony default export */ __webpack_exports__["default"] = (isNumber);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object-like.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object-like.js ***!
- \*************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var isObjectLike = function (value) {
- /**
- * isObjectLike({}) => true
- * isObjectLike([1, 2, 3]) => true
- * isObjectLike(Function) => false
- * isObjectLike(null) => false
- */
- return typeof value === 'object' && value !== null;
- };
- /* harmony default export */ __webpack_exports__["default"] = (isObjectLike);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = (function (value) {
- /**
- * isObject({}) => true
- * isObject([1, 2, 3]) => true
- * isObject(Function) => true
- * isObject(null) => false
- */
- var type = typeof value;
- return value !== null && type === 'object' || type === 'function';
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-odd.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-odd.js ***!
- \*****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
- var isOdd = function (num) {
- return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__["default"])(num) && num % 2 !== 0;
- };
- /* harmony default export */ __webpack_exports__["default"] = (isOdd);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-plain-object.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-plain-object.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_object_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object-like.js");
- /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
- var isPlainObject = function (value) {
- /**
- * isObjectLike(new Foo) => false
- * isObjectLike([1, 2, 3]) => false
- * isObjectLike({ x: 0, y: 0 }) => true
- * isObjectLike(Object.create(null)) => true
- */
- if (!Object(_is_object_like__WEBPACK_IMPORTED_MODULE_0__["default"])(value) || !Object(_is_type__WEBPACK_IMPORTED_MODULE_1__["default"])(value, 'Object')) {
- return false;
- }
- if (Object.getPrototypeOf(value) === null) {
- return true;
- }
- var proto = value;
- while (Object.getPrototypeOf(proto) !== null) {
- proto = Object.getPrototypeOf(proto);
- }
- return Object.getPrototypeOf(value) === proto;
- };
- /* harmony default export */ __webpack_exports__["default"] = (isPlainObject);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-positive.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-positive.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
- var isPositive = function (num) {
- return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__["default"])(num) && num > 0;
- };
- /* harmony default export */ __webpack_exports__["default"] = (isPositive);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-prototype.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-prototype.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var objectProto = Object.prototype;
- var isPrototype = function (value) {
- var Ctor = value && value.constructor;
- var proto = typeof Ctor === 'function' && Ctor.prototype || objectProto;
- return value === proto;
- };
- /* harmony default export */ __webpack_exports__["default"] = (isPrototype);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-reg-exp.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-reg-exp.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
- var isRegExp = function (str) {
- return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(str, 'RegExp');
- };
- /* harmony default export */ __webpack_exports__["default"] = (isRegExp);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
- /* harmony default export */ __webpack_exports__["default"] = (function (str) {
- return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(str, 'String');
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js":
- /*!******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var toString = {}.toString;
- var isType = function (value, type) {
- return toString.call(value) === '[object ' + type + ']';
- };
- /* harmony default export */ __webpack_exports__["default"] = (isType);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-undefined.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-undefined.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var isUndefined = function (value) {
- return value === undefined;
- };
- /* harmony default export */ __webpack_exports__["default"] = (isUndefined);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/keys.js":
- /*!***************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/keys.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
- /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
- var keys = Object.keys ? function (obj) {
- return Object.keys(obj);
- } : function (obj) {
- var result = [];
- Object(_each__WEBPACK_IMPORTED_MODULE_0__["default"])(obj, function (value, key) {
- if (!(Object(_is_function__WEBPACK_IMPORTED_MODULE_1__["default"])(obj) && key === 'prototype')) {
- result.push(key);
- }
- });
- return result;
- };
- /* harmony default export */ __webpack_exports__["default"] = (keys);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/last.js":
- /*!***************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/last.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return last; });
- /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
- function last(o) {
- if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(o)) {
- var arr = o;
- return arr[arr.length - 1];
- }
- return undefined;
- }
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/lower-case.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/lower-case.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-string.js");
- var lowerCase = function (str) {
- return Object(_to_string__WEBPACK_IMPORTED_MODULE_0__["default"])(str).toLowerCase();
- };
- /* harmony default export */ __webpack_exports__["default"] = (lowerCase);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/lower-first.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/lower-first.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-string.js");
- var lowerFirst = function (value) {
- var str = Object(_to_string__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- return str.charAt(0).toLowerCase() + str.substring(1);
- };
- /* harmony default export */ __webpack_exports__["default"] = (lowerFirst);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/map-values.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/map-values.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
- /* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object.js");
- var identity = function (v) {
- return v;
- };
- /* harmony default export */ __webpack_exports__["default"] = (function (object, func) {
- if (func === void 0) {
- func = identity;
- }
- var r = {};
- if (Object(_is_object__WEBPACK_IMPORTED_MODULE_1__["default"])(object) && !Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__["default"])(object)) {
- Object.keys(object).forEach(function (key) {
- // @ts-ignore
- r[key] = func(object[key], key);
- });
- }
- return r;
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/map.js":
- /*!**************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/map.js ***!
- \**************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
- var map = function (arr, func) {
- if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
- // @ts-ignore
- return arr;
- }
- var result = [];
- for (var index = 0; index < arr.length; index++) {
- var value = arr[index];
- result.push(func(value, index));
- }
- return result;
- };
- /* harmony default export */ __webpack_exports__["default"] = (map);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/max-by.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/max-by.js ***!
- \*****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
- /**
- * @param {Array} arr The array to iterate over.
- * @param {Function} [fn] The iteratee invoked per element.
- * @return {*} Returns the maximum value.
- * @example
- *
- * var objects = [{ 'n': 1 }, { 'n': 2 }];
- *
- * maxBy(objects, function(o) { return o.n; });
- * // => { 'n': 2 }
- *
- * maxBy(objects, 'n');
- * // => { 'n': 2 }
- */
- /* harmony default export */ __webpack_exports__["default"] = (function (arr, fn) {
- if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_1__["default"])(arr)) {
- return undefined;
- }
- var max = arr[0];
- var maxData;
- if (Object(_is_function__WEBPACK_IMPORTED_MODULE_2__["default"])(fn)) {
- maxData = fn(arr[0]);
- } else {
- maxData = arr[0][fn];
- }
- var data;
- Object(_each__WEBPACK_IMPORTED_MODULE_0__["default"])(arr, function (val) {
- if (Object(_is_function__WEBPACK_IMPORTED_MODULE_2__["default"])(fn)) {
- data = fn(val);
- } else {
- data = val[fn];
- }
- if (data > maxData) {
- max = val;
- maxData = data;
- }
- });
- return max;
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/memoize.js":
- /*!******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/memoize.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
- /**
- * _.memoize(calColor);
- * _.memoize(calColor, (...args) => args[0]);
- * @param f
- * @param resolver
- */
- /* harmony default export */ __webpack_exports__["default"] = (function (f, resolver) {
- if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_0__["default"])(f)) {
- throw new TypeError('Expected a function');
- }
- var memoized = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- } // 使用方法构造 key,如果不存在 resolver,则直接取第一个参数作为 key
- var key = resolver ? resolver.apply(this, args) : args[0];
- var cache = memoized.cache;
- if (cache.has(key)) {
- return cache.get(key);
- }
- var result = f.apply(this, args); // 缓存起来
- cache.set(key, result);
- return result;
- };
- memoized.cache = new Map();
- return memoized;
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/min-by.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/min-by.js ***!
- \*****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
- /**
- * @param {Array} arr The array to iterate over.
- * @param {Function} [fn] The iteratee invoked per element.
- * @return {*} Returns the minimum value.
- * @example
- *
- * var objects = [{ 'n': 1 }, { 'n': 2 }];
- *
- * minBy(objects, function(o) { return o.n; });
- * // => { 'n': 1 }
- *
- * minBy(objects, 'n');
- * // => { 'n': 1 }
- */
- /* harmony default export */ __webpack_exports__["default"] = (function (arr, fn) {
- if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_1__["default"])(arr)) {
- return undefined;
- }
- var min = arr[0];
- var minData;
- if (Object(_is_function__WEBPACK_IMPORTED_MODULE_2__["default"])(fn)) {
- minData = fn(arr[0]);
- } else {
- minData = arr[0][fn];
- }
- var data;
- Object(_each__WEBPACK_IMPORTED_MODULE_0__["default"])(arr, function (val) {
- if (Object(_is_function__WEBPACK_IMPORTED_MODULE_2__["default"])(fn)) {
- data = fn(val);
- } else {
- data = val[fn];
- }
- if (data < minData) {
- min = val;
- minData = data;
- }
- });
- return min;
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/mix.js":
- /*!**************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/mix.js ***!
- \**************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return mix; });
- // FIXME: Mutable param should be forbidden in static lang.
- function _mix(dist, obj) {
- for (var key in obj) {
- if (obj.hasOwnProperty(key) && key !== 'constructor' && obj[key] !== undefined) {
- dist[key] = obj[key];
- }
- }
- }
- function mix(dist, src1, src2, src3) {
- if (src1) _mix(dist, src1);
- if (src2) _mix(dist, src2);
- if (src3) _mix(dist, src3);
- return dist;
- }
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/mod.js":
- /*!**************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/mod.js ***!
- \**************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var mod = function (n, m) {
- return (n % m + m) % m;
- };
- /* harmony default export */ __webpack_exports__["default"] = (mod);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/noop.js":
- /*!***************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/noop.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = (function () {});
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/number2color.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/number2color.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var numColorCache = {};
- function numberToColor(num) {
- // 增加缓存
- var color = numColorCache[num];
- if (!color) {
- var str = num.toString(16);
- for (var i = str.length; i < 6; i++) {
- str = '0' + str;
- }
- color = '#' + str;
- numColorCache[num] = color;
- }
- return color;
- }
- /* harmony default export */ __webpack_exports__["default"] = (numberToColor);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/parse-radius.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/parse-radius.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- function parseRadius(radius) {
- var r1 = 0,
- r2 = 0,
- r3 = 0,
- r4 = 0;
- if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(radius)) {
- if (radius.length === 1) {
- r1 = r2 = r3 = r4 = radius[0];
- } else if (radius.length === 2) {
- r1 = r3 = radius[0];
- r2 = r4 = radius[1];
- } else if (radius.length === 3) {
- r1 = radius[0];
- r2 = r4 = radius[1];
- r3 = radius[2];
- } else {
- r1 = radius[0];
- r2 = radius[1];
- r3 = radius[2];
- r4 = radius[3];
- }
- } else {
- r1 = r2 = r3 = r4 = radius;
- }
- return {
- r1: r1,
- r2: r2,
- r3: r3,
- r4: r4
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (parseRadius);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/pick.js":
- /*!***************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/pick.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
- /* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-plain-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-plain-object.js");
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- /* harmony default export */ __webpack_exports__["default"] = (function (object, keys) {
- if (object === null || !Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_1__["default"])(object)) {
- return {};
- }
- var result = {};
- Object(_each__WEBPACK_IMPORTED_MODULE_0__["default"])(keys, function (key) {
- if (hasOwnProperty.call(object, key)) {
- result[key] = object[key];
- }
- });
- return result;
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/pull-at.js":
- /*!******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/pull-at.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
- var splice = Array.prototype.splice;
- var pullAt = function pullAt(arr, indexes) {
- if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
- return [];
- }
- var length = arr ? indexes.length : 0;
- var last = length - 1;
- while (length--) {
- var previous = void 0;
- var index = indexes[length];
- if (length === last || index !== previous) {
- previous = index;
- splice.call(arr, index, 1);
- }
- }
- return arr;
- };
- /* harmony default export */ __webpack_exports__["default"] = (pullAt);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/pull.js":
- /*!***************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/pull.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var arrPrototype = Array.prototype;
- var splice = arrPrototype.splice;
- var indexOf = arrPrototype.indexOf;
- var pull = function (arr) {
- var values = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- values[_i - 1] = arguments[_i];
- }
- for (var i = 0; i < values.length; i++) {
- var value = values[i];
- var fromIndex = -1;
- while ((fromIndex = indexOf.call(arr, value)) > -1) {
- splice.call(arr, fromIndex, 1);
- }
- }
- return arr;
- };
- /* harmony default export */ __webpack_exports__["default"] = (pull);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/reduce.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/reduce.js ***!
- \*****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- /* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-plain-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-plain-object.js");
- var reduce = function (arr, fn, init) {
- if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_1__["default"])(arr) && !Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_2__["default"])(arr)) {
- return arr;
- }
- var result = init;
- Object(_each__WEBPACK_IMPORTED_MODULE_0__["default"])(arr, function (data, i) {
- result = fn(result, data, i);
- });
- return result;
- };
- /* harmony default export */ __webpack_exports__["default"] = (reduce);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/remove.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/remove.js ***!
- \*****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
- /* harmony import */ var _pull_at__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pull-at */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/pull-at.js");
- var remove = function (arr, predicate) {
- /**
- * const arr = [1, 2, 3, 4]
- * const evens = remove(arr, n => n % 2 == 0)
- * console.log(arr) // => [1, 3]
- * console.log(evens) // => [2, 4]
- */
- var result = [];
- if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
- return result;
- }
- var i = -1;
- var indexes = [];
- var length = arr.length;
- while (++i < length) {
- var value = arr[i];
- if (predicate(value, i, arr)) {
- result.push(value);
- indexes.push(i);
- }
- }
- Object(_pull_at__WEBPACK_IMPORTED_MODULE_1__["default"])(arr, indexes);
- return result;
- };
- /* harmony default export */ __webpack_exports__["default"] = (remove);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/request-animation-frame.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/request-animation-frame.js ***!
- \**********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return requestAnimationFrame; });
- function requestAnimationFrame(fn) {
- var method = window.requestAnimationFrame || window.webkitRequestAnimationFrame || // @ts-ignore
- window.mozRequestAnimationFrame || // @ts-ignore
- window.msRequestAnimationFrame || function (f) {
- return setTimeout(f, 16);
- };
- return method(fn);
- }
- ;
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/set.js":
- /*!**************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/set.js ***!
- \**************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object.js");
- /* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js");
- /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
- /**
- * https://github.com/developit/dlv/blob/master/index.js
- * @param obj
- * @param path
- * @param value
- */
- /* harmony default export */ __webpack_exports__["default"] = (function (obj, path, value) {
- var o = obj;
- var keyArr = Object(_is_string__WEBPACK_IMPORTED_MODULE_1__["default"])(path) ? path.split('.') : path;
- keyArr.forEach(function (key, idx) {
- // 不是最后一个
- if (idx < keyArr.length - 1) {
- if (!Object(_is_object__WEBPACK_IMPORTED_MODULE_0__["default"])(o[key])) {
- o[key] = Object(_is_number__WEBPACK_IMPORTED_MODULE_2__["default"])(keyArr[idx + 1]) ? [] : {};
- }
- o = o[key];
- } else {
- o[key] = value;
- }
- });
- return obj;
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/size.js":
- /*!***************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/size.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return size; });
- /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
- /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
- function size(o) {
- if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__["default"])(o)) {
- return 0;
- }
- if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__["default"])(o)) {
- return o.length;
- }
- return Object.keys(o).length;
- }
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/some.js":
- /*!***************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/some.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * 只要有一个满足条件就返回 true
- * @param arr
- * @param func
- */
- var some = function (arr, func) {
- for (var i = 0; i < arr.length; i++) {
- if (func(arr[i], i)) return true;
- }
- return false;
- };
- /* harmony default export */ __webpack_exports__["default"] = (some);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/sort-by.js":
- /*!******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/sort-by.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- /* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js");
- /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
- function sortBy(arr, key) {
- var comparer;
- if (Object(_is_function__WEBPACK_IMPORTED_MODULE_2__["default"])(key)) {
- comparer = function (a, b) {
- return key(a) - key(b);
- };
- } else {
- var keys_1 = [];
- if (Object(_is_string__WEBPACK_IMPORTED_MODULE_1__["default"])(key)) {
- keys_1.push(key);
- } else if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(key)) {
- keys_1 = key;
- }
- comparer = function (a, b) {
- for (var i = 0; i < keys_1.length; i += 1) {
- var prop = keys_1[i];
- if (a[prop] > b[prop]) {
- return 1;
- }
- if (a[prop] < b[prop]) {
- return -1;
- }
- }
- return 0;
- };
- }
- arr.sort(comparer);
- return arr;
- }
- /* harmony default export */ __webpack_exports__["default"] = (sortBy);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/starts-with.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/starts-with.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- /* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js");
- function startsWith(arr, e) {
- return Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || Object(_is_string__WEBPACK_IMPORTED_MODULE_1__["default"])(arr) ? arr[0] === e : false;
- }
- /* harmony default export */ __webpack_exports__["default"] = (startsWith);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/substitute.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/substitute.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- function substitute(str, o) {
- if (!str || !o) {
- return str;
- }
- return str.replace(/\\?\{([^{}]+)\}/g, function (match, name) {
- if (match.charAt(0) === '\\') {
- return match.slice(1);
- }
- return o[name] === undefined ? '' : o[name];
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (substitute);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/throttle.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/throttle.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = (function (func, wait, options) {
- var timeout, context, args, result;
- var previous = 0;
- if (!options) options = {};
- var later = function () {
- previous = options.leading === false ? 0 : Date.now();
- timeout = null;
- result = func.apply(context, args);
- if (!timeout) context = args = null;
- };
- var throttled = function () {
- var now = Date.now();
- if (!previous && options.leading === false) previous = now;
- var remaining = wait - (now - previous);
- context = this;
- args = arguments;
- if (remaining <= 0 || remaining > wait) {
- if (timeout) {
- clearTimeout(timeout);
- timeout = null;
- }
- previous = now;
- result = func.apply(context, args);
- if (!timeout) context = args = null;
- } else if (!timeout && options.trailing !== false) {
- timeout = setTimeout(later, remaining);
- }
- return result;
- };
- throttled.cancel = function () {
- clearTimeout(timeout);
- previous = 0;
- timeout = context = args = null;
- };
- return throttled;
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-array.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-array.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
- /* harmony default export */ __webpack_exports__["default"] = (function (value) {
- return Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? Array.prototype.slice.call(value) : [];
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-degree.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-degree.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var DEGREE = 180 / Math.PI;
- var toDegree = function (radian) {
- return DEGREE * radian;
- };
- /* harmony default export */ __webpack_exports__["default"] = (toDegree);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-integer.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-integer.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = (parseInt);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-radian.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-radian.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var RADIAN = Math.PI / 180;
- var toRadian = function (degree) {
- return RADIAN * degree;
- };
- /* harmony default export */ __webpack_exports__["default"] = (toRadian);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-string.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-string.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
- /* harmony default export */ __webpack_exports__["default"] = (function (value) {
- if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) return '';
- return value.toString();
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/union.js":
- /*!****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/union.js ***!
- \****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _uniq__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uniq */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/uniq.js");
- var union = function () {
- var sources = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- sources[_i] = arguments[_i];
- }
- return Object(_uniq__WEBPACK_IMPORTED_MODULE_0__["default"])([].concat.apply([], sources));
- };
- /* harmony default export */ __webpack_exports__["default"] = (union);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/uniq.js":
- /*!***************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/uniq.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contains */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/contains.js");
- /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
- var uniq = function (arr) {
- var resultArr = [];
- Object(_each__WEBPACK_IMPORTED_MODULE_1__["default"])(arr, function (item) {
- if (!Object(_contains__WEBPACK_IMPORTED_MODULE_0__["default"])(resultArr, item)) {
- resultArr.push(item);
- }
- });
- return resultArr;
- };
- /* harmony default export */ __webpack_exports__["default"] = (uniq);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/unique-id.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/unique-id.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var map = {};
- /* harmony default export */ __webpack_exports__["default"] = (function (prefix) {
- prefix = prefix || 'g';
- if (!map[prefix]) {
- map[prefix] = 1;
- } else {
- map[prefix] += 1;
- }
- return prefix + map[prefix];
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/upper-case.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/upper-case.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-string.js");
- var upperCase = function (str) {
- return Object(_to_string__WEBPACK_IMPORTED_MODULE_0__["default"])(str).toUpperCase();
- };
- /* harmony default export */ __webpack_exports__["default"] = (upperCase);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/upper-first.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/upper-first.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-string.js");
- var upperFirst = function (value) {
- var str = Object(_to_string__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- return str.charAt(0).toUpperCase() + str.substring(1);
- };
- /* harmony default export */ __webpack_exports__["default"] = (upperFirst);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/values-of-key.js":
- /*!************************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/values-of-key.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
- /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
- /* harmony default export */ __webpack_exports__["default"] = (function (data, name) {
- var rst = [];
- var tmpMap = {};
- for (var i = 0; i < data.length; i++) {
- var obj = data[i];
- var value = obj[name];
- if (!Object(_is_nil__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
- // flatten
- if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
- value = [value];
- }
- for (var j = 0; j < value.length; j++) {
- var val = value[j]; // unique
- if (!tmpMap[val]) {
- rst.push(val);
- tmpMap[val] = true;
- }
- }
- }
- }
- return rst;
- });
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/values.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/values.js ***!
- \*****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
- /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
- // @ts-ignore
- var values = Object.values ? function (obj) {
- return Object.values(obj);
- } : function (obj) {
- var result = [];
- Object(_each__WEBPACK_IMPORTED_MODULE_0__["default"])(obj, function (value, key) {
- if (!(Object(_is_function__WEBPACK_IMPORTED_MODULE_1__["default"])(obj) && key === 'prototype')) {
- result.push(value);
- }
- });
- return result;
- };
- /* harmony default export */ __webpack_exports__["default"] = (values);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/wrap-behavior.js":
- /*!************************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/wrap-behavior.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * 封装事件,便于使用上下文this,和便于解除事件时使用
- * @protected
- * @param {Object} obj 对象
- * @param {String} action 事件名称
- * @return {Function} 返回事件处理函数
- */
- function wrapBehavior(obj, action) {
- if (obj['_wrap_' + action]) {
- return obj['_wrap_' + action];
- }
- var method = function (e) {
- obj[action](e);
- };
- obj['_wrap_' + action] = method;
- return method;
- }
- /* harmony default export */ __webpack_exports__["default"] = (wrapBehavior);
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/clear-animation-frame.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/clear-animation-frame.js ***!
- \********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- function cancelAnimationFrame(handler) {
- var method = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || // @ts-ignore
- window.mozCancelAnimationFrame || // @ts-ignore
- window.msCancelAnimationFrame || clearTimeout;
- method(handler);
- }
- exports.default = cancelAnimationFrame;
- ;
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js":
- /*!***************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js ***!
- \***************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
- var is_object_1 = __webpack_require__(/*! ./is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js");
- function each(elements, func) {
- if (!elements) {
- return;
- }
- var rst;
- if (is_array_1.default(elements)) {
- for (var i = 0, len = elements.length; i < len; i++) {
- rst = func(elements[i], i);
- if (rst === false) {
- break;
- }
- }
- } else if (is_object_1.default(elements)) {
- for (var k in elements) {
- if (elements.hasOwnProperty(k)) {
- rst = func(elements[k], k);
- if (rst === false) {
- break;
- }
- }
- }
- }
- }
- exports.default = each;
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js ***!
- \*******************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
- exports.default = function (value) {
- return Array.isArray ? Array.isArray(value) : is_type_1.default(value, 'Array');
- };
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js ***!
- \**********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- /**
- * 是否为函数
- * @param {*} fn 对象
- * @return {Boolean} 是否函数
- */
- var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
- exports.default = function (value) {
- return is_type_1.default(value, 'Function');
- };
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js ***!
- \*****************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- }); // isFinite,
- var isNil = function (value) {
- /**
- * isNil(null) => true
- * isNil() => true
- */
- return value === null || value === undefined;
- };
- exports.default = isNil;
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number-equal.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number-equal.js ***!
- \**************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var PRECISION = 0.00001; // numbers less than this is considered as 0
- function isNumberEqual(a, b, precision) {
- if (precision === void 0) {
- precision = PRECISION;
- }
- return Math.abs(a - b) < precision;
- }
- exports.default = isNumberEqual;
- ;
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js ***!
- \********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = function (value) {
- /**
- * isObject({}) => true
- * isObject([1, 2, 3]) => true
- * isObject(Function) => true
- * isObject(null) => false
- */
- var type = typeof value;
- return value !== null && type === 'object' || type === 'function';
- };
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js ***!
- \********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
- exports.default = function (str) {
- return is_type_1.default(str, 'String');
- };
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js":
- /*!******************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js ***!
- \******************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var toString = {}.toString;
- var isType = function (value, type) {
- return toString.call(value) === '[object ' + type + ']';
- };
- exports.default = isType;
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mix.js":
- /*!**************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/mix.js ***!
- \**************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- }); // FIXME: Mutable param should be forbidden in static lang.
- function _mix(dist, obj) {
- for (var key in obj) {
- if (obj.hasOwnProperty(key) && key !== 'constructor' && obj[key] !== undefined) {
- dist[key] = obj[key];
- }
- }
- }
- function mix(dist, src1, src2, src3) {
- if (src1) _mix(dist, src1);
- if (src2) _mix(dist, src2);
- if (src3) _mix(dist, src3);
- return dist;
- }
- exports.default = mix;
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mod.js":
- /*!**************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/mod.js ***!
- \**************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var mod = function (n, m) {
- return (n % m + m) % m;
- };
- exports.default = mod;
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/request-animation-frame.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/request-animation-frame.js ***!
- \**********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- function requestAnimationFrame(fn) {
- var method = window.requestAnimationFrame || window.webkitRequestAnimationFrame || // @ts-ignore
- window.mozRequestAnimationFrame || // @ts-ignore
- window.msRequestAnimationFrame || function (f) {
- return setTimeout(f, 16);
- };
- return method(fn);
- }
- exports.default = requestAnimationFrame;
- ;
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-radian.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-radian.js ***!
- \********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var RADIAN = Math.PI / 180;
- var toRadian = function (degree) {
- return RADIAN * degree;
- };
- exports.default = toRadian;
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-string.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-string.js ***!
- \********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var is_nil_1 = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
- exports.default = function (value) {
- if (is_nil_1.default(value)) return '';
- return value.toString();
- };
- /***/ }),
- /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/upper-first.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/upper-first.js ***!
- \**********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var to_string_1 = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-string.js");
- var upperFirst = function (value) {
- var str = to_string_1.default(value);
- return str.charAt(0).toUpperCase() + str.substring(1);
- };
- exports.default = upperFirst;
- /***/ }),
- /***/ "./node_modules/_d3-color@1.4.1@d3-color/src/color.js":
- /*!************************************************************!*\
- !*** ./node_modules/_d3-color@1.4.1@d3-color/src/color.js ***!
- \************************************************************/
- /*! exports provided: Color, darker, brighter, default, rgbConvert, rgb, Rgb, hslConvert, hsl */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "darker", function() { return darker; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "brighter", function() { return brighter; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return color; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rgbConvert", function() { return rgbConvert; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rgb", function() { return rgb; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rgb", function() { return Rgb; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hslConvert", function() { return hslConvert; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hsl", function() { return hsl; });
- /* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./define.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/define.js");
- function Color() {}
- var darker = 0.7;
- var brighter = 1 / darker;
- var reI = "\\s*([+-]?\\d+)\\s*",
- reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",
- reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
- reHex = /^#([0-9a-f]{3,8})$/,
- reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"),
- reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"),
- reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"),
- reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"),
- reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"),
- reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$");
- var named = {
- aliceblue: 0xf0f8ff,
- antiquewhite: 0xfaebd7,
- aqua: 0x00ffff,
- aquamarine: 0x7fffd4,
- azure: 0xf0ffff,
- beige: 0xf5f5dc,
- bisque: 0xffe4c4,
- black: 0x000000,
- blanchedalmond: 0xffebcd,
- blue: 0x0000ff,
- blueviolet: 0x8a2be2,
- brown: 0xa52a2a,
- burlywood: 0xdeb887,
- cadetblue: 0x5f9ea0,
- chartreuse: 0x7fff00,
- chocolate: 0xd2691e,
- coral: 0xff7f50,
- cornflowerblue: 0x6495ed,
- cornsilk: 0xfff8dc,
- crimson: 0xdc143c,
- cyan: 0x00ffff,
- darkblue: 0x00008b,
- darkcyan: 0x008b8b,
- darkgoldenrod: 0xb8860b,
- darkgray: 0xa9a9a9,
- darkgreen: 0x006400,
- darkgrey: 0xa9a9a9,
- darkkhaki: 0xbdb76b,
- darkmagenta: 0x8b008b,
- darkolivegreen: 0x556b2f,
- darkorange: 0xff8c00,
- darkorchid: 0x9932cc,
- darkred: 0x8b0000,
- darksalmon: 0xe9967a,
- darkseagreen: 0x8fbc8f,
- darkslateblue: 0x483d8b,
- darkslategray: 0x2f4f4f,
- darkslategrey: 0x2f4f4f,
- darkturquoise: 0x00ced1,
- darkviolet: 0x9400d3,
- deeppink: 0xff1493,
- deepskyblue: 0x00bfff,
- dimgray: 0x696969,
- dimgrey: 0x696969,
- dodgerblue: 0x1e90ff,
- firebrick: 0xb22222,
- floralwhite: 0xfffaf0,
- forestgreen: 0x228b22,
- fuchsia: 0xff00ff,
- gainsboro: 0xdcdcdc,
- ghostwhite: 0xf8f8ff,
- gold: 0xffd700,
- goldenrod: 0xdaa520,
- gray: 0x808080,
- green: 0x008000,
- greenyellow: 0xadff2f,
- grey: 0x808080,
- honeydew: 0xf0fff0,
- hotpink: 0xff69b4,
- indianred: 0xcd5c5c,
- indigo: 0x4b0082,
- ivory: 0xfffff0,
- khaki: 0xf0e68c,
- lavender: 0xe6e6fa,
- lavenderblush: 0xfff0f5,
- lawngreen: 0x7cfc00,
- lemonchiffon: 0xfffacd,
- lightblue: 0xadd8e6,
- lightcoral: 0xf08080,
- lightcyan: 0xe0ffff,
- lightgoldenrodyellow: 0xfafad2,
- lightgray: 0xd3d3d3,
- lightgreen: 0x90ee90,
- lightgrey: 0xd3d3d3,
- lightpink: 0xffb6c1,
- lightsalmon: 0xffa07a,
- lightseagreen: 0x20b2aa,
- lightskyblue: 0x87cefa,
- lightslategray: 0x778899,
- lightslategrey: 0x778899,
- lightsteelblue: 0xb0c4de,
- lightyellow: 0xffffe0,
- lime: 0x00ff00,
- limegreen: 0x32cd32,
- linen: 0xfaf0e6,
- magenta: 0xff00ff,
- maroon: 0x800000,
- mediumaquamarine: 0x66cdaa,
- mediumblue: 0x0000cd,
- mediumorchid: 0xba55d3,
- mediumpurple: 0x9370db,
- mediumseagreen: 0x3cb371,
- mediumslateblue: 0x7b68ee,
- mediumspringgreen: 0x00fa9a,
- mediumturquoise: 0x48d1cc,
- mediumvioletred: 0xc71585,
- midnightblue: 0x191970,
- mintcream: 0xf5fffa,
- mistyrose: 0xffe4e1,
- moccasin: 0xffe4b5,
- navajowhite: 0xffdead,
- navy: 0x000080,
- oldlace: 0xfdf5e6,
- olive: 0x808000,
- olivedrab: 0x6b8e23,
- orange: 0xffa500,
- orangered: 0xff4500,
- orchid: 0xda70d6,
- palegoldenrod: 0xeee8aa,
- palegreen: 0x98fb98,
- paleturquoise: 0xafeeee,
- palevioletred: 0xdb7093,
- papayawhip: 0xffefd5,
- peachpuff: 0xffdab9,
- peru: 0xcd853f,
- pink: 0xffc0cb,
- plum: 0xdda0dd,
- powderblue: 0xb0e0e6,
- purple: 0x800080,
- rebeccapurple: 0x663399,
- red: 0xff0000,
- rosybrown: 0xbc8f8f,
- royalblue: 0x4169e1,
- saddlebrown: 0x8b4513,
- salmon: 0xfa8072,
- sandybrown: 0xf4a460,
- seagreen: 0x2e8b57,
- seashell: 0xfff5ee,
- sienna: 0xa0522d,
- silver: 0xc0c0c0,
- skyblue: 0x87ceeb,
- slateblue: 0x6a5acd,
- slategray: 0x708090,
- slategrey: 0x708090,
- snow: 0xfffafa,
- springgreen: 0x00ff7f,
- steelblue: 0x4682b4,
- tan: 0xd2b48c,
- teal: 0x008080,
- thistle: 0xd8bfd8,
- tomato: 0xff6347,
- turquoise: 0x40e0d0,
- violet: 0xee82ee,
- wheat: 0xf5deb3,
- white: 0xffffff,
- whitesmoke: 0xf5f5f5,
- yellow: 0xffff00,
- yellowgreen: 0x9acd32
- };
- Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Color, color, {
- copy: function (channels) {
- return Object.assign(new this.constructor(), this, channels);
- },
- displayable: function () {
- return this.rgb().displayable();
- },
- hex: color_formatHex,
- // Deprecated! Use color.formatHex.
- formatHex: color_formatHex,
- formatHsl: color_formatHsl,
- formatRgb: color_formatRgb,
- toString: color_formatRgb
- });
- function color_formatHex() {
- return this.rgb().formatHex();
- }
- function color_formatHsl() {
- return hslConvert(this).formatHsl();
- }
- function color_formatRgb() {
- return this.rgb().formatRgb();
- }
- function color(format) {
- var m, l;
- format = (format + "").trim().toLowerCase();
- return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
- : l === 3 ? new Rgb(m >> 8 & 0xf | m >> 4 & 0xf0, m >> 4 & 0xf | m & 0xf0, (m & 0xf) << 4 | m & 0xf, 1) // #f00
- : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
- : l === 4 ? rgba(m >> 12 & 0xf | m >> 8 & 0xf0, m >> 8 & 0xf | m >> 4 & 0xf0, m >> 4 & 0xf | m & 0xf0, ((m & 0xf) << 4 | m & 0xf) / 0xff) // #f000
- : null // invalid hex
- ) : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
- : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
- : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
- : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
- : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
- : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
- : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
- : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
- }
- function rgbn(n) {
- return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
- }
- function rgba(r, g, b, a) {
- if (a <= 0) r = g = b = NaN;
- return new Rgb(r, g, b, a);
- }
- function rgbConvert(o) {
- if (!(o instanceof Color)) o = color(o);
- if (!o) return new Rgb();
- o = o.rgb();
- return new Rgb(o.r, o.g, o.b, o.opacity);
- }
- function rgb(r, g, b, opacity) {
- return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
- }
- function Rgb(r, g, b, opacity) {
- this.r = +r;
- this.g = +g;
- this.b = +b;
- this.opacity = +opacity;
- }
- Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Rgb, rgb, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["extend"])(Color, {
- brighter: function (k) {
- k = k == null ? brighter : Math.pow(brighter, k);
- return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
- },
- darker: function (k) {
- k = k == null ? darker : Math.pow(darker, k);
- return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
- },
- rgb: function () {
- return this;
- },
- displayable: function () {
- return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
- },
- hex: rgb_formatHex,
- // Deprecated! Use color.formatHex.
- formatHex: rgb_formatHex,
- formatRgb: rgb_formatRgb,
- toString: rgb_formatRgb
- }));
- function rgb_formatHex() {
- return "#" + hex(this.r) + hex(this.g) + hex(this.b);
- }
- function rgb_formatRgb() {
- var a = this.opacity;
- a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
- return (a === 1 ? "rgb(" : "rgba(") + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + (a === 1 ? ")" : ", " + a + ")");
- }
- function hex(value) {
- value = Math.max(0, Math.min(255, Math.round(value) || 0));
- return (value < 16 ? "0" : "") + value.toString(16);
- }
- function hsla(h, s, l, a) {
- if (a <= 0) h = s = l = NaN;else if (l <= 0 || l >= 1) h = s = NaN;else if (s <= 0) h = NaN;
- return new Hsl(h, s, l, a);
- }
- function hslConvert(o) {
- if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
- if (!(o instanceof Color)) o = color(o);
- if (!o) return new Hsl();
- if (o instanceof Hsl) return o;
- o = o.rgb();
- var r = o.r / 255,
- g = o.g / 255,
- b = o.b / 255,
- min = Math.min(r, g, b),
- max = Math.max(r, g, b),
- h = NaN,
- s = max - min,
- l = (max + min) / 2;
- if (s) {
- if (r === max) h = (g - b) / s + (g < b) * 6;else if (g === max) h = (b - r) / s + 2;else h = (r - g) / s + 4;
- s /= l < 0.5 ? max + min : 2 - max - min;
- h *= 60;
- } else {
- s = l > 0 && l < 1 ? 0 : h;
- }
- return new Hsl(h, s, l, o.opacity);
- }
- function hsl(h, s, l, opacity) {
- return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
- }
- function Hsl(h, s, l, opacity) {
- this.h = +h;
- this.s = +s;
- this.l = +l;
- this.opacity = +opacity;
- }
- Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Hsl, hsl, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["extend"])(Color, {
- brighter: function (k) {
- k = k == null ? brighter : Math.pow(brighter, k);
- return new Hsl(this.h, this.s, this.l * k, this.opacity);
- },
- darker: function (k) {
- k = k == null ? darker : Math.pow(darker, k);
- return new Hsl(this.h, this.s, this.l * k, this.opacity);
- },
- rgb: function () {
- var h = this.h % 360 + (this.h < 0) * 360,
- s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
- l = this.l,
- m2 = l + (l < 0.5 ? l : 1 - l) * s,
- m1 = 2 * l - m2;
- return new Rgb(hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), hsl2rgb(h, m1, m2), hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), this.opacity);
- },
- displayable: function () {
- return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
- },
- formatHsl: function () {
- var a = this.opacity;
- a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
- return (a === 1 ? "hsl(" : "hsla(") + (this.h || 0) + ", " + (this.s || 0) * 100 + "%, " + (this.l || 0) * 100 + "%" + (a === 1 ? ")" : ", " + a + ")");
- }
- }));
- /* From FvD 13.37, CSS Color Module Level 3 */
- function hsl2rgb(h, m1, m2) {
- return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
- }
- /***/ }),
- /***/ "./node_modules/_d3-color@1.4.1@d3-color/src/cubehelix.js":
- /*!****************************************************************!*\
- !*** ./node_modules/_d3-color@1.4.1@d3-color/src/cubehelix.js ***!
- \****************************************************************/
- /*! exports provided: default, Cubehelix */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return cubehelix; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Cubehelix", function() { return Cubehelix; });
- /* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./define.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/define.js");
- /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/color.js");
- /* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/math.js");
- var A = -0.14861,
- B = +1.78277,
- C = -0.29227,
- D = -0.90649,
- E = +1.97294,
- ED = E * D,
- EB = E * B,
- BC_DA = B * C - D * A;
- function cubehelixConvert(o) {
- if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);
- if (!(o instanceof _color_js__WEBPACK_IMPORTED_MODULE_1__["Rgb"])) o = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["rgbConvert"])(o);
- var r = o.r / 255,
- g = o.g / 255,
- b = o.b / 255,
- l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),
- bl = b - l,
- k = (E * (g - l) - C * bl) / D,
- s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)),
- // NaN if l=0 or l=1
- h = s ? Math.atan2(k, bl) * _math_js__WEBPACK_IMPORTED_MODULE_2__["rad2deg"] - 120 : NaN;
- return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);
- }
- function cubehelix(h, s, l, opacity) {
- return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);
- }
- function Cubehelix(h, s, l, opacity) {
- this.h = +h;
- this.s = +s;
- this.l = +l;
- this.opacity = +opacity;
- }
- Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Cubehelix, cubehelix, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["extend"])(_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"], {
- brighter: function (k) {
- k = k == null ? _color_js__WEBPACK_IMPORTED_MODULE_1__["brighter"] : Math.pow(_color_js__WEBPACK_IMPORTED_MODULE_1__["brighter"], k);
- return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
- },
- darker: function (k) {
- k = k == null ? _color_js__WEBPACK_IMPORTED_MODULE_1__["darker"] : Math.pow(_color_js__WEBPACK_IMPORTED_MODULE_1__["darker"], k);
- return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
- },
- rgb: function () {
- var h = isNaN(this.h) ? 0 : (this.h + 120) * _math_js__WEBPACK_IMPORTED_MODULE_2__["deg2rad"],
- l = +this.l,
- a = isNaN(this.s) ? 0 : this.s * l * (1 - l),
- cosh = Math.cos(h),
- sinh = Math.sin(h);
- return new _color_js__WEBPACK_IMPORTED_MODULE_1__["Rgb"](255 * (l + a * (A * cosh + B * sinh)), 255 * (l + a * (C * cosh + D * sinh)), 255 * (l + a * (E * cosh)), this.opacity);
- }
- }));
- /***/ }),
- /***/ "./node_modules/_d3-color@1.4.1@d3-color/src/define.js":
- /*!*************************************************************!*\
- !*** ./node_modules/_d3-color@1.4.1@d3-color/src/define.js ***!
- \*************************************************************/
- /*! exports provided: default, extend */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return extend; });
- /* harmony default export */ __webpack_exports__["default"] = (function (constructor, factory, prototype) {
- constructor.prototype = factory.prototype = prototype;
- prototype.constructor = constructor;
- });
- function extend(parent, definition) {
- var prototype = Object.create(parent.prototype);
- for (var key in definition) prototype[key] = definition[key];
- return prototype;
- }
- /***/ }),
- /***/ "./node_modules/_d3-color@1.4.1@d3-color/src/index.js":
- /*!************************************************************!*\
- !*** ./node_modules/_d3-color@1.4.1@d3-color/src/index.js ***!
- \************************************************************/
- /*! exports provided: color, rgb, hsl, lab, hcl, lch, gray, cubehelix */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/color.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "color", function() { return _color_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rgb", function() { return _color_js__WEBPACK_IMPORTED_MODULE_0__["rgb"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hsl", function() { return _color_js__WEBPACK_IMPORTED_MODULE_0__["hsl"]; });
- /* harmony import */ var _lab_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lab.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/lab.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lab", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hcl", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__["hcl"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lch", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__["lch"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gray", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__["gray"]; });
- /* harmony import */ var _cubehelix_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cubehelix.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/cubehelix.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cubehelix", function() { return _cubehelix_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /***/ }),
- /***/ "./node_modules/_d3-color@1.4.1@d3-color/src/lab.js":
- /*!**********************************************************!*\
- !*** ./node_modules/_d3-color@1.4.1@d3-color/src/lab.js ***!
- \**********************************************************/
- /*! exports provided: gray, default, Lab, lch, hcl, Hcl */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gray", function() { return gray; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return lab; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Lab", function() { return Lab; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lch", function() { return lch; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hcl", function() { return hcl; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hcl", function() { return Hcl; });
- /* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./define.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/define.js");
- /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/color.js");
- /* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/math.js");
- // https://observablehq.com/@mbostock/lab-and-rgb
- var K = 18,
- Xn = 0.96422,
- Yn = 1,
- Zn = 0.82521,
- t0 = 4 / 29,
- t1 = 6 / 29,
- t2 = 3 * t1 * t1,
- t3 = t1 * t1 * t1;
- function labConvert(o) {
- if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);
- if (o instanceof Hcl) return hcl2lab(o);
- if (!(o instanceof _color_js__WEBPACK_IMPORTED_MODULE_1__["Rgb"])) o = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["rgbConvert"])(o);
- var r = rgb2lrgb(o.r),
- g = rgb2lrgb(o.g),
- b = rgb2lrgb(o.b),
- y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn),
- x,
- z;
- if (r === g && g === b) x = z = y;else {
- x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);
- z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);
- }
- return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);
- }
- function gray(l, opacity) {
- return new Lab(l, 0, 0, opacity == null ? 1 : opacity);
- }
- function lab(l, a, b, opacity) {
- return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);
- }
- function Lab(l, a, b, opacity) {
- this.l = +l;
- this.a = +a;
- this.b = +b;
- this.opacity = +opacity;
- }
- Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Lab, lab, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["extend"])(_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"], {
- brighter: function (k) {
- return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);
- },
- darker: function (k) {
- return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);
- },
- rgb: function () {
- var y = (this.l + 16) / 116,
- x = isNaN(this.a) ? y : y + this.a / 500,
- z = isNaN(this.b) ? y : y - this.b / 200;
- x = Xn * lab2xyz(x);
- y = Yn * lab2xyz(y);
- z = Zn * lab2xyz(z);
- return new _color_js__WEBPACK_IMPORTED_MODULE_1__["Rgb"](lrgb2rgb(3.1338561 * x - 1.6168667 * y - 0.4906146 * z), lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z), lrgb2rgb(0.0719453 * x - 0.2289914 * y + 1.4052427 * z), this.opacity);
- }
- }));
- function xyz2lab(t) {
- return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;
- }
- function lab2xyz(t) {
- return t > t1 ? t * t * t : t2 * (t - t0);
- }
- function lrgb2rgb(x) {
- return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
- }
- function rgb2lrgb(x) {
- return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
- }
- function hclConvert(o) {
- if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);
- if (!(o instanceof Lab)) o = labConvert(o);
- if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);
- var h = Math.atan2(o.b, o.a) * _math_js__WEBPACK_IMPORTED_MODULE_2__["rad2deg"];
- return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);
- }
- function lch(l, c, h, opacity) {
- return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
- }
- function hcl(h, c, l, opacity) {
- return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
- }
- function Hcl(h, c, l, opacity) {
- this.h = +h;
- this.c = +c;
- this.l = +l;
- this.opacity = +opacity;
- }
- function hcl2lab(o) {
- if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);
- var h = o.h * _math_js__WEBPACK_IMPORTED_MODULE_2__["deg2rad"];
- return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);
- }
- Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Hcl, hcl, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["extend"])(_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"], {
- brighter: function (k) {
- return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);
- },
- darker: function (k) {
- return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);
- },
- rgb: function () {
- return hcl2lab(this).rgb();
- }
- }));
- /***/ }),
- /***/ "./node_modules/_d3-color@1.4.1@d3-color/src/math.js":
- /*!***********************************************************!*\
- !*** ./node_modules/_d3-color@1.4.1@d3-color/src/math.js ***!
- \***********************************************************/
- /*! exports provided: deg2rad, rad2deg */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deg2rad", function() { return deg2rad; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rad2deg", function() { return rad2deg; });
- var deg2rad = Math.PI / 180;
- var rad2deg = 180 / Math.PI;
- /***/ }),
- /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/back.js":
- /*!*********************************************************!*\
- !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/back.js ***!
- \*********************************************************/
- /*! exports provided: backIn, backOut, backInOut */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "backIn", function() { return backIn; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "backOut", function() { return backOut; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "backInOut", function() { return backInOut; });
- var overshoot = 1.70158;
- var backIn = function custom(s) {
- s = +s;
- function backIn(t) {
- return t * t * ((s + 1) * t - s);
- }
- backIn.overshoot = custom;
- return backIn;
- }(overshoot);
- var backOut = function custom(s) {
- s = +s;
- function backOut(t) {
- return --t * t * ((s + 1) * t + s) + 1;
- }
- backOut.overshoot = custom;
- return backOut;
- }(overshoot);
- var backInOut = function custom(s) {
- s = +s;
- function backInOut(t) {
- return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;
- }
- backInOut.overshoot = custom;
- return backInOut;
- }(overshoot);
- /***/ }),
- /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/bounce.js":
- /*!***********************************************************!*\
- !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/bounce.js ***!
- \***********************************************************/
- /*! exports provided: bounceIn, bounceOut, bounceInOut */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bounceIn", function() { return bounceIn; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bounceOut", function() { return bounceOut; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bounceInOut", function() { return bounceInOut; });
- var b1 = 4 / 11,
- b2 = 6 / 11,
- b3 = 8 / 11,
- b4 = 3 / 4,
- b5 = 9 / 11,
- b6 = 10 / 11,
- b7 = 15 / 16,
- b8 = 21 / 22,
- b9 = 63 / 64,
- b0 = 1 / b1 / b1;
- function bounceIn(t) {
- return 1 - bounceOut(1 - t);
- }
- function bounceOut(t) {
- return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;
- }
- function bounceInOut(t) {
- return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;
- }
- /***/ }),
- /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/circle.js":
- /*!***********************************************************!*\
- !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/circle.js ***!
- \***********************************************************/
- /*! exports provided: circleIn, circleOut, circleInOut */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "circleIn", function() { return circleIn; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "circleOut", function() { return circleOut; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "circleInOut", function() { return circleInOut; });
- function circleIn(t) {
- return 1 - Math.sqrt(1 - t * t);
- }
- function circleOut(t) {
- return Math.sqrt(1 - --t * t);
- }
- function circleInOut(t) {
- return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;
- }
- /***/ }),
- /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/cubic.js":
- /*!**********************************************************!*\
- !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/cubic.js ***!
- \**********************************************************/
- /*! exports provided: cubicIn, cubicOut, cubicInOut */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cubicIn", function() { return cubicIn; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cubicOut", function() { return cubicOut; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cubicInOut", function() { return cubicInOut; });
- function cubicIn(t) {
- return t * t * t;
- }
- function cubicOut(t) {
- return --t * t * t + 1;
- }
- function cubicInOut(t) {
- return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
- }
- /***/ }),
- /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/elastic.js":
- /*!************************************************************!*\
- !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/elastic.js ***!
- \************************************************************/
- /*! exports provided: elasticIn, elasticOut, elasticInOut */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elasticIn", function() { return elasticIn; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elasticOut", function() { return elasticOut; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elasticInOut", function() { return elasticInOut; });
- var tau = 2 * Math.PI,
- amplitude = 1,
- period = 0.3;
- var elasticIn = function custom(a, p) {
- var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
- function elasticIn(t) {
- return a * Math.pow(2, 10 * --t) * Math.sin((s - t) / p);
- }
- elasticIn.amplitude = function (a) {
- return custom(a, p * tau);
- };
- elasticIn.period = function (p) {
- return custom(a, p);
- };
- return elasticIn;
- }(amplitude, period);
- var elasticOut = function custom(a, p) {
- var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
- function elasticOut(t) {
- return 1 - a * Math.pow(2, -10 * (t = +t)) * Math.sin((t + s) / p);
- }
- elasticOut.amplitude = function (a) {
- return custom(a, p * tau);
- };
- elasticOut.period = function (p) {
- return custom(a, p);
- };
- return elasticOut;
- }(amplitude, period);
- var elasticInOut = function custom(a, p) {
- var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
- function elasticInOut(t) {
- return ((t = t * 2 - 1) < 0 ? a * Math.pow(2, 10 * t) * Math.sin((s - t) / p) : 2 - a * Math.pow(2, -10 * t) * Math.sin((s + t) / p)) / 2;
- }
- elasticInOut.amplitude = function (a) {
- return custom(a, p * tau);
- };
- elasticInOut.period = function (p) {
- return custom(a, p);
- };
- return elasticInOut;
- }(amplitude, period);
- /***/ }),
- /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/exp.js":
- /*!********************************************************!*\
- !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/exp.js ***!
- \********************************************************/
- /*! exports provided: expIn, expOut, expInOut */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expIn", function() { return expIn; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expOut", function() { return expOut; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expInOut", function() { return expInOut; });
- function expIn(t) {
- return Math.pow(2, 10 * t - 10);
- }
- function expOut(t) {
- return 1 - Math.pow(2, -10 * t);
- }
- function expInOut(t) {
- return ((t *= 2) <= 1 ? Math.pow(2, 10 * t - 10) : 2 - Math.pow(2, 10 - 10 * t)) / 2;
- }
- /***/ }),
- /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/index.js":
- /*!**********************************************************!*\
- !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/index.js ***!
- \**********************************************************/
- /*! exports provided: easeLinear, easeQuad, easeQuadIn, easeQuadOut, easeQuadInOut, easeCubic, easeCubicIn, easeCubicOut, easeCubicInOut, easePoly, easePolyIn, easePolyOut, easePolyInOut, easeSin, easeSinIn, easeSinOut, easeSinInOut, easeExp, easeExpIn, easeExpOut, easeExpInOut, easeCircle, easeCircleIn, easeCircleOut, easeCircleInOut, easeBounce, easeBounceIn, easeBounceOut, easeBounceInOut, easeBack, easeBackIn, easeBackOut, easeBackInOut, easeElastic, easeElasticIn, easeElasticOut, easeElasticInOut */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _linear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./linear.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/linear.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeLinear", function() { return _linear_js__WEBPACK_IMPORTED_MODULE_0__["linear"]; });
- /* harmony import */ var _quad_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quad.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/quad.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuad", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__["quadInOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuadIn", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__["quadIn"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuadOut", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__["quadOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuadInOut", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__["quadInOut"]; });
- /* harmony import */ var _cubic_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cubic.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/cubic.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubic", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__["cubicInOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubicIn", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__["cubicIn"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubicOut", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__["cubicOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubicInOut", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__["cubicInOut"]; });
- /* harmony import */ var _poly_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./poly.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/poly.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePoly", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__["polyInOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePolyIn", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__["polyIn"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePolyOut", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__["polyOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePolyInOut", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__["polyInOut"]; });
- /* harmony import */ var _sin_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sin.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/sin.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSin", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__["sinInOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSinIn", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__["sinIn"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSinOut", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__["sinOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSinInOut", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__["sinInOut"]; });
- /* harmony import */ var _exp_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./exp.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/exp.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExp", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__["expInOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExpIn", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__["expIn"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExpOut", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__["expOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExpInOut", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__["expInOut"]; });
- /* harmony import */ var _circle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./circle.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/circle.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircle", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__["circleInOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircleIn", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__["circleIn"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircleOut", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__["circleOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircleInOut", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__["circleInOut"]; });
- /* harmony import */ var _bounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./bounce.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/bounce.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounce", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__["bounceOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounceIn", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__["bounceIn"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounceOut", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__["bounceOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounceInOut", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__["bounceInOut"]; });
- /* harmony import */ var _back_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./back.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/back.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBack", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__["backInOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBackIn", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__["backIn"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBackOut", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__["backOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBackInOut", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__["backInOut"]; });
- /* harmony import */ var _elastic_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./elastic.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/elastic.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElastic", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__["elasticOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElasticIn", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__["elasticIn"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElasticOut", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__["elasticOut"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElasticInOut", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__["elasticInOut"]; });
- /***/ }),
- /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/linear.js":
- /*!***********************************************************!*\
- !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/linear.js ***!
- \***********************************************************/
- /*! exports provided: linear */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linear", function() { return linear; });
- function linear(t) {
- return +t;
- }
- /***/ }),
- /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/poly.js":
- /*!*********************************************************!*\
- !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/poly.js ***!
- \*********************************************************/
- /*! exports provided: polyIn, polyOut, polyInOut */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "polyIn", function() { return polyIn; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "polyOut", function() { return polyOut; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "polyInOut", function() { return polyInOut; });
- var exponent = 3;
- var polyIn = function custom(e) {
- e = +e;
- function polyIn(t) {
- return Math.pow(t, e);
- }
- polyIn.exponent = custom;
- return polyIn;
- }(exponent);
- var polyOut = function custom(e) {
- e = +e;
- function polyOut(t) {
- return 1 - Math.pow(1 - t, e);
- }
- polyOut.exponent = custom;
- return polyOut;
- }(exponent);
- var polyInOut = function custom(e) {
- e = +e;
- function polyInOut(t) {
- return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;
- }
- polyInOut.exponent = custom;
- return polyInOut;
- }(exponent);
- /***/ }),
- /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/quad.js":
- /*!*********************************************************!*\
- !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/quad.js ***!
- \*********************************************************/
- /*! exports provided: quadIn, quadOut, quadInOut */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "quadIn", function() { return quadIn; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "quadOut", function() { return quadOut; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "quadInOut", function() { return quadInOut; });
- function quadIn(t) {
- return t * t;
- }
- function quadOut(t) {
- return t * (2 - t);
- }
- function quadInOut(t) {
- return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2;
- }
- /***/ }),
- /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/sin.js":
- /*!********************************************************!*\
- !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/sin.js ***!
- \********************************************************/
- /*! exports provided: sinIn, sinOut, sinInOut */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sinIn", function() { return sinIn; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sinOut", function() { return sinOut; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sinInOut", function() { return sinInOut; });
- var pi = Math.PI,
- halfPi = pi / 2;
- function sinIn(t) {
- return 1 - Math.cos(t * halfPi);
- }
- function sinOut(t) {
- return Math.sin(t * halfPi);
- }
- function sinInOut(t) {
- return (1 - Math.cos(pi * t)) / 2;
- }
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/array.js":
- /*!************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/array.js ***!
- \************************************************************************/
- /*! exports provided: default, genericArray */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genericArray", function() { return genericArray; });
- /* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/value.js");
- /* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./numberArray.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/numberArray.js");
- /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
- return (Object(_numberArray_js__WEBPACK_IMPORTED_MODULE_1__["isNumberArray"])(b) ? _numberArray_js__WEBPACK_IMPORTED_MODULE_1__["default"] : genericArray)(a, b);
- });
- function genericArray(a, b) {
- var nb = b ? b.length : 0,
- na = a ? Math.min(nb, a.length) : 0,
- x = new Array(na),
- c = new Array(nb),
- i;
- for (i = 0; i < na; ++i) x[i] = Object(_value_js__WEBPACK_IMPORTED_MODULE_0__["default"])(a[i], b[i]);
- for (; i < nb; ++i) c[i] = b[i];
- return function (t) {
- for (i = 0; i < na; ++i) c[i] = x[i](t);
- return c;
- };
- }
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basis.js":
- /*!************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basis.js ***!
- \************************************************************************/
- /*! exports provided: basis, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basis", function() { return basis; });
- function basis(t1, v0, v1, v2, v3) {
- var t2 = t1 * t1,
- t3 = t2 * t1;
- return ((1 - 3 * t1 + 3 * t2 - t3) * v0 + (4 - 6 * t2 + 3 * t3) * v1 + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 + t3 * v3) / 6;
- }
- /* harmony default export */ __webpack_exports__["default"] = (function (values) {
- var n = values.length - 1;
- return function (t) {
- var i = t <= 0 ? t = 0 : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),
- v1 = values[i],
- v2 = values[i + 1],
- v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,
- v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
- return basis((t - i / n) * n, v0, v1, v2, v3);
- };
- });
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basisClosed.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basisClosed.js ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basis.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basis.js");
- /* harmony default export */ __webpack_exports__["default"] = (function (values) {
- var n = values.length;
- return function (t) {
- var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),
- v0 = values[(i + n - 1) % n],
- v1 = values[i % n],
- v2 = values[(i + 1) % n],
- v3 = values[(i + 2) % n];
- return Object(_basis_js__WEBPACK_IMPORTED_MODULE_0__["basis"])((t - i / n) * n, v0, v1, v2, v3);
- };
- });
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js":
- /*!************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js ***!
- \************************************************************************/
- /*! exports provided: hue, gamma, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hue", function() { return hue; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gamma", function() { return gamma; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return nogamma; });
- /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/constant.js");
- function linear(a, d) {
- return function (t) {
- return a + t * d;
- };
- }
- function exponential(a, b, y) {
- return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function (t) {
- return Math.pow(a + t * b, y);
- };
- }
- function hue(a, b) {
- var d = b - a;
- return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(isNaN(a) ? b : a);
- }
- function gamma(y) {
- return (y = +y) === 1 ? nogamma : function (a, b) {
- return b - a ? exponential(a, b, y) : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(isNaN(a) ? b : a);
- };
- }
- function nogamma(a, b) {
- var d = b - a;
- return d ? linear(a, d) : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(isNaN(a) ? b : a);
- }
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/constant.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/constant.js ***!
- \***************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = (function (x) {
- return function () {
- return x;
- };
- });
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/cubehelix.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/cubehelix.js ***!
- \****************************************************************************/
- /*! exports provided: default, cubehelixLong */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cubehelixLong", function() { return cubehelixLong; });
- /* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "./node_modules/_d3-color@1.4.1@d3-color/src/index.js");
- /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js");
- function cubehelix(hue) {
- return function cubehelixGamma(y) {
- y = +y;
- function cubehelix(start, end) {
- var h = hue((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["cubehelix"])(start)).h, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["cubehelix"])(end)).h),
- s = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.s, end.s),
- l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.l, end.l),
- opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.opacity, end.opacity);
- return function (t) {
- start.h = h(t);
- start.s = s(t);
- start.l = l(Math.pow(t, y));
- start.opacity = opacity(t);
- return start + "";
- };
- }
- cubehelix.gamma = cubehelixGamma;
- return cubehelix;
- }(1);
- }
- /* harmony default export */ __webpack_exports__["default"] = (cubehelix(_color_js__WEBPACK_IMPORTED_MODULE_1__["hue"]));
- var cubehelixLong = cubehelix(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/date.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/date.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
- var d = new Date();
- return a = +a, b = +b, function (t) {
- return d.setTime(a * (1 - t) + b * t), d;
- };
- });
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/discrete.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/discrete.js ***!
- \***************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = (function (range) {
- var n = range.length;
- return function (t) {
- return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];
- };
- });
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hcl.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hcl.js ***!
- \**********************************************************************/
- /*! exports provided: default, hclLong */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hclLong", function() { return hclLong; });
- /* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "./node_modules/_d3-color@1.4.1@d3-color/src/index.js");
- /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js");
- function hcl(hue) {
- return function (start, end) {
- var h = hue((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["hcl"])(start)).h, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["hcl"])(end)).h),
- c = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.c, end.c),
- l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.l, end.l),
- opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.opacity, end.opacity);
- return function (t) {
- start.h = h(t);
- start.c = c(t);
- start.l = l(t);
- start.opacity = opacity(t);
- return start + "";
- };
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (hcl(_color_js__WEBPACK_IMPORTED_MODULE_1__["hue"]));
- var hclLong = hcl(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hsl.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hsl.js ***!
- \**********************************************************************/
- /*! exports provided: default, hslLong */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hslLong", function() { return hslLong; });
- /* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "./node_modules/_d3-color@1.4.1@d3-color/src/index.js");
- /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js");
- function hsl(hue) {
- return function (start, end) {
- var h = hue((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["hsl"])(start)).h, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["hsl"])(end)).h),
- s = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.s, end.s),
- l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.l, end.l),
- opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.opacity, end.opacity);
- return function (t) {
- start.h = h(t);
- start.s = s(t);
- start.l = l(t);
- start.opacity = opacity(t);
- return start + "";
- };
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (hsl(_color_js__WEBPACK_IMPORTED_MODULE_1__["hue"]));
- var hslLong = hsl(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hue.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hue.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js");
- /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
- var i = Object(_color_js__WEBPACK_IMPORTED_MODULE_0__["hue"])(+a, +b);
- return function (t) {
- var x = i(t);
- return x - 360 * Math.floor(x / 360);
- };
- });
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/index.js":
- /*!************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/index.js ***!
- \************************************************************************/
- /*! exports provided: interpolate, interpolateArray, interpolateBasis, interpolateBasisClosed, interpolateDate, interpolateDiscrete, interpolateHue, interpolateNumber, interpolateNumberArray, interpolateObject, interpolateRound, interpolateString, interpolateTransformCss, interpolateTransformSvg, interpolateZoom, interpolateRgb, interpolateRgbBasis, interpolateRgbBasisClosed, interpolateHsl, interpolateHslLong, interpolateLab, interpolateHcl, interpolateHclLong, interpolateCubehelix, interpolateCubehelixLong, piecewise, quantize */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/value.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolate", function() { return _value_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./array.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/array.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateArray", function() { return _array_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./basis.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basis.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBasis", function() { return _basis_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _basisClosed_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./basisClosed.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basisClosed.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBasisClosed", function() { return _basisClosed_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./date.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/date.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateDate", function() { return _date_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _discrete_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./discrete.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/discrete.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateDiscrete", function() { return _discrete_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _hue_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./hue.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hue.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHue", function() { return _hue_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./number.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/number.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateNumber", function() { return _number_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./numberArray.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/numberArray.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateNumberArray", function() { return _numberArray_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./object.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/object.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateObject", function() { return _object_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./round.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/round.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRound", function() { return _round_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./string.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/string.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateString", function() { return _string_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
- /* harmony import */ var _transform_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./transform/index.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/index.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateTransformCss", function() { return _transform_index_js__WEBPACK_IMPORTED_MODULE_12__["interpolateTransformCss"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateTransformSvg", function() { return _transform_index_js__WEBPACK_IMPORTED_MODULE_12__["interpolateTransformSvg"]; });
- /* harmony import */ var _zoom_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./zoom.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/zoom.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateZoom", function() { return _zoom_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
- /* harmony import */ var _rgb_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./rgb.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/rgb.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRgb", function() { return _rgb_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRgbBasis", function() { return _rgb_js__WEBPACK_IMPORTED_MODULE_14__["rgbBasis"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRgbBasisClosed", function() { return _rgb_js__WEBPACK_IMPORTED_MODULE_14__["rgbBasisClosed"]; });
- /* harmony import */ var _hsl_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./hsl.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hsl.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHsl", function() { return _hsl_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHslLong", function() { return _hsl_js__WEBPACK_IMPORTED_MODULE_15__["hslLong"]; });
- /* harmony import */ var _lab_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./lab.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/lab.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateLab", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
- /* harmony import */ var _hcl_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./hcl.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hcl.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHcl", function() { return _hcl_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHclLong", function() { return _hcl_js__WEBPACK_IMPORTED_MODULE_17__["hclLong"]; });
- /* harmony import */ var _cubehelix_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./cubehelix.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/cubehelix.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateCubehelix", function() { return _cubehelix_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateCubehelixLong", function() { return _cubehelix_js__WEBPACK_IMPORTED_MODULE_18__["cubehelixLong"]; });
- /* harmony import */ var _piecewise_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./piecewise.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/piecewise.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "piecewise", function() { return _piecewise_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
- /* harmony import */ var _quantize_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./quantize.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/quantize.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "quantize", function() { return _quantize_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/lab.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/lab.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return lab; });
- /* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "./node_modules/_d3-color@1.4.1@d3-color/src/index.js");
- /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js");
- function lab(start, end) {
- var l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["lab"])(start)).l, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["lab"])(end)).l),
- a = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.a, end.a),
- b = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.b, end.b),
- opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.opacity, end.opacity);
- return function (t) {
- start.l = l(t);
- start.a = a(t);
- start.b = b(t);
- start.opacity = opacity(t);
- return start + "";
- };
- }
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/number.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/number.js ***!
- \*************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
- return a = +a, b = +b, function (t) {
- return a * (1 - t) + b * t;
- };
- });
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/numberArray.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/numberArray.js ***!
- \******************************************************************************/
- /*! exports provided: default, isNumberArray */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumberArray", function() { return isNumberArray; });
- /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
- if (!b) b = [];
- var n = a ? Math.min(b.length, a.length) : 0,
- c = b.slice(),
- i;
- return function (t) {
- for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
- return c;
- };
- });
- function isNumberArray(x) {
- return ArrayBuffer.isView(x) && !(x instanceof DataView);
- }
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/object.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/object.js ***!
- \*************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/value.js");
- /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
- var i = {},
- c = {},
- k;
- if (a === null || typeof a !== "object") a = {};
- if (b === null || typeof b !== "object") b = {};
- for (k in b) {
- if (k in a) {
- i[k] = Object(_value_js__WEBPACK_IMPORTED_MODULE_0__["default"])(a[k], b[k]);
- } else {
- c[k] = b[k];
- }
- }
- return function (t) {
- for (k in i) c[k] = i[k](t);
- return c;
- };
- });
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/piecewise.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/piecewise.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return piecewise; });
- function piecewise(interpolate, values) {
- var i = 0,
- n = values.length - 1,
- v = values[0],
- I = new Array(n < 0 ? 0 : n);
- while (i < n) I[i] = interpolate(v, v = values[++i]);
- return function (t) {
- var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));
- return I[i](t - i);
- };
- }
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/quantize.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/quantize.js ***!
- \***************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = (function (interpolator, n) {
- var samples = new Array(n);
- for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));
- return samples;
- });
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/rgb.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/rgb.js ***!
- \**********************************************************************/
- /*! exports provided: default, rgbBasis, rgbBasisClosed */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rgbBasis", function() { return rgbBasis; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rgbBasisClosed", function() { return rgbBasisClosed; });
- /* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "./node_modules/_d3-color@1.4.1@d3-color/src/index.js");
- /* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./basis.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basis.js");
- /* harmony import */ var _basisClosed_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./basisClosed.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basisClosed.js");
- /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js");
- /* harmony default export */ __webpack_exports__["default"] = ((function rgbGamma(y) {
- var color = Object(_color_js__WEBPACK_IMPORTED_MODULE_3__["gamma"])(y);
- function rgb(start, end) {
- var r = color((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["rgb"])(start)).r, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["rgb"])(end)).r),
- g = color(start.g, end.g),
- b = color(start.b, end.b),
- opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_3__["default"])(start.opacity, end.opacity);
- return function (t) {
- start.r = r(t);
- start.g = g(t);
- start.b = b(t);
- start.opacity = opacity(t);
- return start + "";
- };
- }
- rgb.gamma = rgbGamma;
- return rgb;
- })(1));
- function rgbSpline(spline) {
- return function (colors) {
- var n = colors.length,
- r = new Array(n),
- g = new Array(n),
- b = new Array(n),
- i,
- color;
- for (i = 0; i < n; ++i) {
- color = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["rgb"])(colors[i]);
- r[i] = color.r || 0;
- g[i] = color.g || 0;
- b[i] = color.b || 0;
- }
- r = spline(r);
- g = spline(g);
- b = spline(b);
- color.opacity = 1;
- return function (t) {
- color.r = r(t);
- color.g = g(t);
- color.b = b(t);
- return color + "";
- };
- };
- }
- var rgbBasis = rgbSpline(_basis_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- var rgbBasisClosed = rgbSpline(_basisClosed_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/round.js":
- /*!************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/round.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
- return a = +a, b = +b, function (t) {
- return Math.round(a * (1 - t) + b * t);
- };
- });
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/string.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/string.js ***!
- \*************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./number.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/number.js");
- var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
- reB = new RegExp(reA.source, "g");
- function zero(b) {
- return function () {
- return b;
- };
- }
- function one(b) {
- return function (t) {
- return b(t) + "";
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
- var bi = reA.lastIndex = reB.lastIndex = 0,
- // scan index for next number in b
- am,
- // current match in a
- bm,
- // current match in b
- bs,
- // string preceding current number in b, if any
- i = -1,
- // index in s
- s = [],
- // string constants and placeholders
- q = []; // number interpolators
- // Coerce inputs to strings.
- a = a + "", b = b + ""; // Interpolate pairs of numbers in a & b.
- while ((am = reA.exec(a)) && (bm = reB.exec(b))) {
- if ((bs = bm.index) > bi) {
- // a string precedes the next number in b
- bs = b.slice(bi, bs);
- if (s[i]) s[i] += bs; // coalesce with previous string
- else s[++i] = bs;
- }
- if ((am = am[0]) === (bm = bm[0])) {
- // numbers in a & b match
- if (s[i]) s[i] += bm; // coalesce with previous string
- else s[++i] = bm;
- } else {
- // interpolate non-matching numbers
- s[++i] = null;
- q.push({
- i: i,
- x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(am, bm)
- });
- }
- bi = reB.lastIndex;
- } // Add remains of b.
- if (bi < b.length) {
- bs = b.slice(bi);
- if (s[i]) s[i] += bs; // coalesce with previous string
- else s[++i] = bs;
- } // Special optimization for only a single match.
- // Otherwise, interpolate each of the numbers and rejoin the string.
- return s.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function (t) {
- for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
- return s.join("");
- });
- });
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/decompose.js":
- /*!**************************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/decompose.js ***!
- \**************************************************************************************/
- /*! exports provided: identity, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
- var degrees = 180 / Math.PI;
- var identity = {
- translateX: 0,
- translateY: 0,
- rotate: 0,
- skewX: 0,
- scaleX: 1,
- scaleY: 1
- };
- /* harmony default export */ __webpack_exports__["default"] = (function (a, b, c, d, e, f) {
- var scaleX, scaleY, skewX;
- if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;
- if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;
- if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;
- if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
- return {
- translateX: e,
- translateY: f,
- rotate: Math.atan2(b, a) * degrees,
- skewX: Math.atan(skewX) * degrees,
- scaleX: scaleX,
- scaleY: scaleY
- };
- });
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/index.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/index.js ***!
- \**********************************************************************************/
- /*! exports provided: interpolateTransformCss, interpolateTransformSvg */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "interpolateTransformCss", function() { return interpolateTransformCss; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "interpolateTransformSvg", function() { return interpolateTransformSvg; });
- /* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../number.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/number.js");
- /* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parse.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/parse.js");
- function interpolateTransform(parse, pxComma, pxParen, degParen) {
- function pop(s) {
- return s.length ? s.pop() + " " : "";
- }
- function translate(xa, ya, xb, yb, s, q) {
- if (xa !== xb || ya !== yb) {
- var i = s.push("translate(", null, pxComma, null, pxParen);
- q.push({
- i: i - 4,
- x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(xa, xb)
- }, {
- i: i - 2,
- x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(ya, yb)
- });
- } else if (xb || yb) {
- s.push("translate(" + xb + pxComma + yb + pxParen);
- }
- }
- function rotate(a, b, s, q) {
- if (a !== b) {
- if (a - b > 180) b += 360;else if (b - a > 180) a += 360; // shortest path
- q.push({
- i: s.push(pop(s) + "rotate(", null, degParen) - 2,
- x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(a, b)
- });
- } else if (b) {
- s.push(pop(s) + "rotate(" + b + degParen);
- }
- }
- function skewX(a, b, s, q) {
- if (a !== b) {
- q.push({
- i: s.push(pop(s) + "skewX(", null, degParen) - 2,
- x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(a, b)
- });
- } else if (b) {
- s.push(pop(s) + "skewX(" + b + degParen);
- }
- }
- function scale(xa, ya, xb, yb, s, q) {
- if (xa !== xb || ya !== yb) {
- var i = s.push(pop(s) + "scale(", null, ",", null, ")");
- q.push({
- i: i - 4,
- x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(xa, xb)
- }, {
- i: i - 2,
- x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(ya, yb)
- });
- } else if (xb !== 1 || yb !== 1) {
- s.push(pop(s) + "scale(" + xb + "," + yb + ")");
- }
- }
- return function (a, b) {
- var s = [],
- // string constants and placeholders
- q = []; // number interpolators
- a = parse(a), b = parse(b);
- translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);
- rotate(a.rotate, b.rotate, s, q);
- skewX(a.skewX, b.skewX, s, q);
- scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);
- a = b = null; // gc
- return function (t) {
- var i = -1,
- n = q.length,
- o;
- while (++i < n) s[(o = q[i]).i] = o.x(t);
- return s.join("");
- };
- };
- }
- var interpolateTransformCss = interpolateTransform(_parse_js__WEBPACK_IMPORTED_MODULE_1__["parseCss"], "px, ", "px)", "deg)");
- var interpolateTransformSvg = interpolateTransform(_parse_js__WEBPACK_IMPORTED_MODULE_1__["parseSvg"], ", ", ")", ")");
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/parse.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/parse.js ***!
- \**********************************************************************************/
- /*! exports provided: parseCss, parseSvg */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseCss", function() { return parseCss; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseSvg", function() { return parseSvg; });
- /* harmony import */ var _decompose_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./decompose.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/decompose.js");
- var cssNode, cssRoot, cssView, svgNode;
- function parseCss(value) {
- if (value === "none") return _decompose_js__WEBPACK_IMPORTED_MODULE_0__["identity"];
- if (!cssNode) cssNode = document.createElement("DIV"), cssRoot = document.documentElement, cssView = document.defaultView;
- cssNode.style.transform = value;
- value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue("transform");
- cssRoot.removeChild(cssNode);
- value = value.slice(7, -1).split(",");
- return Object(_decompose_js__WEBPACK_IMPORTED_MODULE_0__["default"])(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]);
- }
- function parseSvg(value) {
- if (value == null) return _decompose_js__WEBPACK_IMPORTED_MODULE_0__["identity"];
- if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
- svgNode.setAttribute("transform", value);
- if (!(value = svgNode.transform.baseVal.consolidate())) return _decompose_js__WEBPACK_IMPORTED_MODULE_0__["identity"];
- value = value.matrix;
- return Object(_decompose_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value.a, value.b, value.c, value.d, value.e, value.f);
- }
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/value.js":
- /*!************************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/value.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "./node_modules/_d3-color@1.4.1@d3-color/src/index.js");
- /* harmony import */ var _rgb_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rgb.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/rgb.js");
- /* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./array.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/array.js");
- /* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./date.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/date.js");
- /* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./number.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/number.js");
- /* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./object.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/object.js");
- /* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./string.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/string.js");
- /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./constant.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/constant.js");
- /* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./numberArray.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/numberArray.js");
- /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
- var t = typeof b,
- c;
- return b == null || t === "boolean" ? Object(_constant_js__WEBPACK_IMPORTED_MODULE_7__["default"])(b) : (t === "number" ? _number_js__WEBPACK_IMPORTED_MODULE_4__["default"] : t === "string" ? (c = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["color"])(b)) ? (b = c, _rgb_js__WEBPACK_IMPORTED_MODULE_1__["default"]) : _string_js__WEBPACK_IMPORTED_MODULE_6__["default"] : b instanceof d3_color__WEBPACK_IMPORTED_MODULE_0__["color"] ? _rgb_js__WEBPACK_IMPORTED_MODULE_1__["default"] : b instanceof Date ? _date_js__WEBPACK_IMPORTED_MODULE_3__["default"] : Object(_numberArray_js__WEBPACK_IMPORTED_MODULE_8__["isNumberArray"])(b) ? _numberArray_js__WEBPACK_IMPORTED_MODULE_8__["default"] : Array.isArray(b) ? _array_js__WEBPACK_IMPORTED_MODULE_2__["genericArray"] : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? _object_js__WEBPACK_IMPORTED_MODULE_5__["default"] : _number_js__WEBPACK_IMPORTED_MODULE_4__["default"])(a, b);
- });
- /***/ }),
- /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/zoom.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/zoom.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var rho = Math.SQRT2,
- rho2 = 2,
- rho4 = 4,
- epsilon2 = 1e-12;
- function cosh(x) {
- return ((x = Math.exp(x)) + 1 / x) / 2;
- }
- function sinh(x) {
- return ((x = Math.exp(x)) - 1 / x) / 2;
- }
- function tanh(x) {
- return ((x = Math.exp(2 * x)) - 1) / (x + 1);
- } // p0 = [ux0, uy0, w0]
- // p1 = [ux1, uy1, w1]
- /* harmony default export */ __webpack_exports__["default"] = (function (p0, p1) {
- var ux0 = p0[0],
- uy0 = p0[1],
- w0 = p0[2],
- ux1 = p1[0],
- uy1 = p1[1],
- w1 = p1[2],
- dx = ux1 - ux0,
- dy = uy1 - uy0,
- d2 = dx * dx + dy * dy,
- i,
- S; // Special case for u0 ≅ u1.
- if (d2 < epsilon2) {
- S = Math.log(w1 / w0) / rho;
- i = function (t) {
- return [ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(rho * t * S)];
- };
- } // General case.
- else {
- var d1 = Math.sqrt(d2),
- b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),
- b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),
- r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),
- r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
- S = (r1 - r0) / rho;
- i = function (t) {
- var s = t * S,
- coshr0 = cosh(r0),
- u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
- return [ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / cosh(rho * s + r0)];
- };
- }
- i.duration = S * 1000;
- return i;
- });
- /***/ }),
- /***/ "./node_modules/_d3-timer@1.0.10@d3-timer/src/index.js":
- /*!*************************************************************!*\
- !*** ./node_modules/_d3-timer@1.0.10@d3-timer/src/index.js ***!
- \*************************************************************/
- /*! exports provided: now, timer, timerFlush, timeout, interval */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ "./node_modules/_d3-timer@1.0.10@d3-timer/src/timer.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "now", function() { return _timer_js__WEBPACK_IMPORTED_MODULE_0__["now"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return _timer_js__WEBPACK_IMPORTED_MODULE_0__["timer"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timerFlush", function() { return _timer_js__WEBPACK_IMPORTED_MODULE_0__["timerFlush"]; });
- /* harmony import */ var _timeout_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./timeout.js */ "./node_modules/_d3-timer@1.0.10@d3-timer/src/timeout.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return _timeout_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./interval.js */ "./node_modules/_d3-timer@1.0.10@d3-timer/src/interval.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return _interval_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /***/ }),
- /***/ "./node_modules/_d3-timer@1.0.10@d3-timer/src/interval.js":
- /*!****************************************************************!*\
- !*** ./node_modules/_d3-timer@1.0.10@d3-timer/src/interval.js ***!
- \****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ "./node_modules/_d3-timer@1.0.10@d3-timer/src/timer.js");
- /* harmony default export */ __webpack_exports__["default"] = (function (callback, delay, time) {
- var t = new _timer_js__WEBPACK_IMPORTED_MODULE_0__["Timer"](),
- total = delay;
- if (delay == null) return t.restart(callback, delay, time), t;
- delay = +delay, time = time == null ? Object(_timer_js__WEBPACK_IMPORTED_MODULE_0__["now"])() : +time;
- t.restart(function tick(elapsed) {
- elapsed += total;
- t.restart(tick, total += delay, time);
- callback(elapsed);
- }, delay, time);
- return t;
- });
- /***/ }),
- /***/ "./node_modules/_d3-timer@1.0.10@d3-timer/src/timeout.js":
- /*!***************************************************************!*\
- !*** ./node_modules/_d3-timer@1.0.10@d3-timer/src/timeout.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ "./node_modules/_d3-timer@1.0.10@d3-timer/src/timer.js");
- /* harmony default export */ __webpack_exports__["default"] = (function (callback, delay, time) {
- var t = new _timer_js__WEBPACK_IMPORTED_MODULE_0__["Timer"]();
- delay = delay == null ? 0 : +delay;
- t.restart(function (elapsed) {
- t.stop();
- callback(elapsed + delay);
- }, delay, time);
- return t;
- });
- /***/ }),
- /***/ "./node_modules/_d3-timer@1.0.10@d3-timer/src/timer.js":
- /*!*************************************************************!*\
- !*** ./node_modules/_d3-timer@1.0.10@d3-timer/src/timer.js ***!
- \*************************************************************/
- /*! exports provided: now, Timer, timer, timerFlush */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "now", function() { return now; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return Timer; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return timer; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timerFlush", function() { return timerFlush; });
- var frame = 0,
- // is an animation frame pending?
- timeout = 0,
- // is a timeout pending?
- interval = 0,
- // are any timers active?
- pokeDelay = 1000,
- // how frequently we check for clock skew
- taskHead,
- taskTail,
- clockLast = 0,
- clockNow = 0,
- clockSkew = 0,
- clock = typeof performance === "object" && performance.now ? performance : Date,
- setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (f) {
- setTimeout(f, 17);
- };
- function now() {
- return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
- }
- function clearNow() {
- clockNow = 0;
- }
- function Timer() {
- this._call = this._time = this._next = null;
- }
- Timer.prototype = timer.prototype = {
- constructor: Timer,
- restart: function (callback, delay, time) {
- if (typeof callback !== "function") throw new TypeError("callback is not a function");
- time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
- if (!this._next && taskTail !== this) {
- if (taskTail) taskTail._next = this;else taskHead = this;
- taskTail = this;
- }
- this._call = callback;
- this._time = time;
- sleep();
- },
- stop: function () {
- if (this._call) {
- this._call = null;
- this._time = Infinity;
- sleep();
- }
- }
- };
- function timer(callback, delay, time) {
- var t = new Timer();
- t.restart(callback, delay, time);
- return t;
- }
- function timerFlush() {
- now(); // Get the current time, if not already set.
- ++frame; // Pretend we’ve set an alarm, if we haven’t already.
- var t = taskHead,
- e;
- while (t) {
- if ((e = clockNow - t._time) >= 0) t._call.call(null, e);
- t = t._next;
- }
- --frame;
- }
- function wake() {
- clockNow = (clockLast = clock.now()) + clockSkew;
- frame = timeout = 0;
- try {
- timerFlush();
- } finally {
- frame = 0;
- nap();
- clockNow = 0;
- }
- }
- function poke() {
- var now = clock.now(),
- delay = now - clockLast;
- if (delay > pokeDelay) clockSkew -= delay, clockLast = now;
- }
- function nap() {
- var t0,
- t1 = taskHead,
- t2,
- time = Infinity;
- while (t1) {
- if (t1._call) {
- if (time > t1._time) time = t1._time;
- t0 = t1, t1 = t1._next;
- } else {
- t2 = t1._next, t1._next = null;
- t1 = t0 ? t0._next = t2 : taskHead = t2;
- }
- }
- taskTail = t0;
- sleep(time);
- }
- function sleep(time) {
- if (frame) return; // Soonest alarm already set, or will be.
- if (timeout) timeout = clearTimeout(timeout);
- var delay = time - clockNow; // Strictly less than if we recomputed clockNow.
- if (delay > 24) {
- if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);
- if (interval) interval = clearInterval(interval);
- } else {
- if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
- frame = 1, setFrame(wake);
- }
- }
- /***/ }),
- /***/ "./node_modules/_detect-browser@5.1.0@detect-browser/index.js":
- /*!********************************************************************!*\
- !*** ./node_modules/_detect-browser@5.1.0@detect-browser/index.js ***!
- \********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(process) {
- var __spreadArrays = this && this.__spreadArrays || function () {
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
- for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
- return r;
- };
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var BrowserInfo =
- /** @class */
- function () {
- function BrowserInfo(name, version, os) {
- this.name = name;
- this.version = version;
- this.os = os;
- this.type = 'browser';
- }
- return BrowserInfo;
- }();
- exports.BrowserInfo = BrowserInfo;
- var NodeInfo =
- /** @class */
- function () {
- function NodeInfo(version) {
- this.version = version;
- this.type = 'node';
- this.name = 'node';
- this.os = process.platform;
- }
- return NodeInfo;
- }();
- exports.NodeInfo = NodeInfo;
- var SearchBotDeviceInfo =
- /** @class */
- function () {
- function SearchBotDeviceInfo(name, version, os, bot) {
- this.name = name;
- this.version = version;
- this.os = os;
- this.bot = bot;
- this.type = 'bot-device';
- }
- return SearchBotDeviceInfo;
- }();
- exports.SearchBotDeviceInfo = SearchBotDeviceInfo;
- var BotInfo =
- /** @class */
- function () {
- function BotInfo() {
- this.type = 'bot';
- this.bot = true; // NOTE: deprecated test name instead
- this.name = 'bot';
- this.version = null;
- this.os = null;
- }
- return BotInfo;
- }();
- exports.BotInfo = BotInfo;
- var ReactNativeInfo =
- /** @class */
- function () {
- function ReactNativeInfo() {
- this.type = 'react-native';
- this.name = 'react-native';
- this.version = null;
- this.os = null;
- }
- return ReactNativeInfo;
- }();
- exports.ReactNativeInfo = ReactNativeInfo;
- ; // tslint:disable-next-line:max-line-length
- var SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/;
- var SEARCHBOT_OS_REGEX = /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/;
- var REQUIRED_VERSION_PARTS = 3;
- var userAgentRules = [['aol', /AOLShield\/([0-9\._]+)/], ['edge', /Edge\/([0-9\._]+)/], ['edge-ios', /EdgiOS\/([0-9\._]+)/], ['yandexbrowser', /YaBrowser\/([0-9\._]+)/], ['kakaotalk', /KAKAOTALK\s([0-9\.]+)/], ['samsung', /SamsungBrowser\/([0-9\.]+)/], ['silk', /\bSilk\/([0-9._-]+)\b/], ['miui', /MiuiBrowser\/([0-9\.]+)$/], ['beaker', /BeakerBrowser\/([0-9\.]+)/], ['edge-chromium', /Edg\/([0-9\.]+)/], ['chromium-webview', /(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/], ['chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/], ['phantomjs', /PhantomJS\/([0-9\.]+)(:?\s|$)/], ['crios', /CriOS\/([0-9\.]+)(:?\s|$)/], ['firefox', /Firefox\/([0-9\.]+)(?:\s|$)/], ['fxios', /FxiOS\/([0-9\.]+)/], ['opera-mini', /Opera Mini.*Version\/([0-9\.]+)/], ['opera', /Opera\/([0-9\.]+)(?:\s|$)/], ['opera', /OPR\/([0-9\.]+)(:?\s|$)/], ['ie', /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/], ['ie', /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], ['ie', /MSIE\s(7\.0)/], ['bb10', /BB10;\sTouch.*Version\/([0-9\.]+)/], ['android', /Android\s([0-9\.]+)/], ['ios', /Version\/([0-9\._]+).*Mobile.*Safari.*/], ['safari', /Version\/([0-9\._]+).*Safari/], ['facebook', /FBAV\/([0-9\.]+)/], ['instagram', /Instagram\s([0-9\.]+)/], ['ios-webview', /AppleWebKit\/([0-9\.]+).*Mobile/], ['ios-webview', /AppleWebKit\/([0-9\.]+).*Gecko\)$/], ['searchbot', SEARCHBOX_UA_REGEX]];
- var operatingSystemRules = [['iOS', /iP(hone|od|ad)/], ['Android OS', /Android/], ['BlackBerry OS', /BlackBerry|BB10/], ['Windows Mobile', /IEMobile/], ['Amazon OS', /Kindle/], ['Windows 3.11', /Win16/], ['Windows 95', /(Windows 95)|(Win95)|(Windows_95)/], ['Windows 98', /(Windows 98)|(Win98)/], ['Windows 2000', /(Windows NT 5.0)|(Windows 2000)/], ['Windows XP', /(Windows NT 5.1)|(Windows XP)/], ['Windows Server 2003', /(Windows NT 5.2)/], ['Windows Vista', /(Windows NT 6.0)/], ['Windows 7', /(Windows NT 6.1)/], ['Windows 8', /(Windows NT 6.2)/], ['Windows 8.1', /(Windows NT 6.3)/], ['Windows 10', /(Windows NT 10.0)/], ['Windows ME', /Windows ME/], ['Open BSD', /OpenBSD/], ['Sun OS', /SunOS/], ['Chrome OS', /CrOS/], ['Linux', /(Linux)|(X11)/], ['Mac OS', /(Mac_PowerPC)|(Macintosh)/], ['QNX', /QNX/], ['BeOS', /BeOS/], ['OS/2', /OS\/2/]];
- function detect(userAgent) {
- if (!!userAgent) {
- return parseUserAgent(userAgent);
- }
- if (typeof document === 'undefined' && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
- return new ReactNativeInfo();
- }
- if (typeof navigator !== 'undefined') {
- return parseUserAgent(navigator.userAgent);
- }
- return getNodeVersion();
- }
- exports.detect = detect;
- function matchUserAgent(ua) {
- // opted for using reduce here rather than Array#first with a regex.test call
- // this is primarily because using the reduce we only perform the regex
- // execution once rather than once for the test and for the exec again below
- // probably something that needs to be benchmarked though
- return ua !== '' && userAgentRules.reduce(function (matched, _a) {
- var browser = _a[0],
- regex = _a[1];
- if (matched) {
- return matched;
- }
- var uaMatch = regex.exec(ua);
- return !!uaMatch && [browser, uaMatch];
- }, false);
- }
- function browserName(ua) {
- var data = matchUserAgent(ua);
- return data ? data[0] : null;
- }
- exports.browserName = browserName;
- function parseUserAgent(ua) {
- var matchedRule = matchUserAgent(ua);
- if (!matchedRule) {
- return null;
- }
- var name = matchedRule[0],
- match = matchedRule[1];
- if (name === 'searchbot') {
- return new BotInfo();
- }
- var versionParts = match[1] && match[1].split(/[._]/).slice(0, 3);
- if (versionParts) {
- if (versionParts.length < REQUIRED_VERSION_PARTS) {
- versionParts = __spreadArrays(versionParts, createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length));
- }
- } else {
- versionParts = [];
- }
- var version = versionParts.join('.');
- var os = detectOS(ua);
- var searchBotMatch = SEARCHBOT_OS_REGEX.exec(ua);
- if (searchBotMatch && searchBotMatch[1]) {
- return new SearchBotDeviceInfo(name, version, os, searchBotMatch[1]);
- }
- return new BrowserInfo(name, versionParts.join('.'), os);
- }
- exports.parseUserAgent = parseUserAgent;
- function detectOS(ua) {
- for (var ii = 0, count = operatingSystemRules.length; ii < count; ii++) {
- var _a = operatingSystemRules[ii],
- os = _a[0],
- regex = _a[1];
- var match = regex.exec(ua);
- if (match) {
- return os;
- }
- }
- return null;
- }
- exports.detectOS = detectOS;
- function getNodeVersion() {
- var isNode = typeof process !== 'undefined' && process.version;
- return isNode ? new NodeInfo(process.version.slice(1)) : null;
- }
- exports.getNodeVersion = getNodeVersion;
- function createVersionParts(count) {
- var output = [];
- for (var ii = 0; ii < count; ii++) {
- output.push('0');
- }
- return output;
- }
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../_process@0.11.10@process/browser.js */ "./node_modules/_process@0.11.10@process/browser.js")))
- /***/ }),
- /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js":
- /*!***************************************************************!*\
- !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js ***!
- \***************************************************************/
- /*! exports provided: EPSILON, ARRAY_TYPE, RANDOM, setMatrixArrayType, toRadian, equals */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EPSILON", function() { return EPSILON; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARRAY_TYPE", function() { return ARRAY_TYPE; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RANDOM", function() { return RANDOM; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setMatrixArrayType", function() { return setMatrixArrayType; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toRadian", function() { return toRadian; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
- /**
- * Common utilities
- * @module glMatrix
- */
- // Configuration Constants
- var EPSILON = 0.000001;
- var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;
- var RANDOM = Math.random;
- /**
- * Sets the type of array used when creating new vectors and matrices
- *
- * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array
- */
- function setMatrixArrayType(type) {
- ARRAY_TYPE = type;
- }
- var degree = Math.PI / 180;
- /**
- * Convert Degree To Radian
- *
- * @param {Number} a Angle in Degrees
- */
- function toRadian(a) {
- return a * degree;
- }
- /**
- * Tests whether or not the arguments have approximately the same value, within an absolute
- * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less
- * than or equal to 1.0, and a relative tolerance is used for larger values)
- *
- * @param {Number} a The first number to test.
- * @param {Number} b The second number to test.
- * @returns {Boolean} True if the numbers are approximately equal, false otherwise.
- */
- function equals(a, b) {
- return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));
- }
- if (!Math.hypot) Math.hypot = function () {
- var y = 0,
- i = arguments.length;
- while (i--) {
- y += arguments[i] * arguments[i];
- }
- return Math.sqrt(y);
- };
- /***/ }),
- /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/index.js":
- /*!**************************************************************!*\
- !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/index.js ***!
- \**************************************************************/
- /*! exports provided: glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
- /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "glMatrix", function() { return _common_js__WEBPACK_IMPORTED_MODULE_0__; });
- /* harmony import */ var _mat2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mat2.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat2.js");
- /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "mat2", function() { return _mat2_js__WEBPACK_IMPORTED_MODULE_1__; });
- /* harmony import */ var _mat2d_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mat2d.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat2d.js");
- /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "mat2d", function() { return _mat2d_js__WEBPACK_IMPORTED_MODULE_2__; });
- /* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mat3.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat3.js");
- /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "mat3", function() { return _mat3_js__WEBPACK_IMPORTED_MODULE_3__; });
- /* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mat4.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat4.js");
- /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "mat4", function() { return _mat4_js__WEBPACK_IMPORTED_MODULE_4__; });
- /* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./quat.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/quat.js");
- /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "quat", function() { return _quat_js__WEBPACK_IMPORTED_MODULE_5__; });
- /* harmony import */ var _quat2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./quat2.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/quat2.js");
- /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "quat2", function() { return _quat2_js__WEBPACK_IMPORTED_MODULE_6__; });
- /* harmony import */ var _vec2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vec2.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec2.js");
- /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "vec2", function() { return _vec2_js__WEBPACK_IMPORTED_MODULE_7__; });
- /* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./vec3.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec3.js");
- /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "vec3", function() { return _vec3_js__WEBPACK_IMPORTED_MODULE_8__; });
- /* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./vec4.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec4.js");
- /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "vec4", function() { return _vec4_js__WEBPACK_IMPORTED_MODULE_9__; });
- /***/ }),
- /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat2.js":
- /*!*************************************************************!*\
- !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat2.js ***!
- \*************************************************************/
- /*! exports provided: create, clone, copy, identity, fromValues, set, transpose, invert, adjoint, determinant, multiply, rotate, scale, fromRotation, fromScaling, str, frob, LDU, add, subtract, exactEquals, equals, multiplyScalar, multiplyScalarAndAdd, mul, sub */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return transpose; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjoint", function() { return adjoint; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "determinant", function() { return determinant; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotate", function() { return rotate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotation", function() { return fromRotation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromScaling", function() { return fromScaling; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "frob", function() { return frob; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LDU", function() { return LDU; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalar", function() { return multiplyScalar; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalarAndAdd", function() { return multiplyScalarAndAdd; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
- /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
- /**
- * 2x2 Matrix
- * @module mat2
- */
- /**
- * Creates a new identity mat2
- *
- * @returns {mat2} a new 2x2 matrix
- */
- function create() {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
- if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
- out[1] = 0;
- out[2] = 0;
- }
- out[0] = 1;
- out[3] = 1;
- return out;
- }
- /**
- * Creates a new mat2 initialized with values from an existing matrix
- *
- * @param {ReadonlyMat2} a matrix to clone
- * @returns {mat2} a new 2x2 matrix
- */
- function clone(a) {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- return out;
- }
- /**
- * Copy the values from one mat2 to another
- *
- * @param {mat2} out the receiving matrix
- * @param {ReadonlyMat2} a the source matrix
- * @returns {mat2} out
- */
- function copy(out, a) {
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- return out;
- }
- /**
- * Set a mat2 to the identity matrix
- *
- * @param {mat2} out the receiving matrix
- * @returns {mat2} out
- */
- function identity(out) {
- out[0] = 1;
- out[1] = 0;
- out[2] = 0;
- out[3] = 1;
- return out;
- }
- /**
- * Create a new mat2 with the given values
- *
- * @param {Number} m00 Component in column 0, row 0 position (index 0)
- * @param {Number} m01 Component in column 0, row 1 position (index 1)
- * @param {Number} m10 Component in column 1, row 0 position (index 2)
- * @param {Number} m11 Component in column 1, row 1 position (index 3)
- * @returns {mat2} out A new 2x2 matrix
- */
- function fromValues(m00, m01, m10, m11) {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
- out[0] = m00;
- out[1] = m01;
- out[2] = m10;
- out[3] = m11;
- return out;
- }
- /**
- * Set the components of a mat2 to the given values
- *
- * @param {mat2} out the receiving matrix
- * @param {Number} m00 Component in column 0, row 0 position (index 0)
- * @param {Number} m01 Component in column 0, row 1 position (index 1)
- * @param {Number} m10 Component in column 1, row 0 position (index 2)
- * @param {Number} m11 Component in column 1, row 1 position (index 3)
- * @returns {mat2} out
- */
- function set(out, m00, m01, m10, m11) {
- out[0] = m00;
- out[1] = m01;
- out[2] = m10;
- out[3] = m11;
- return out;
- }
- /**
- * Transpose the values of a mat2
- *
- * @param {mat2} out the receiving matrix
- * @param {ReadonlyMat2} a the source matrix
- * @returns {mat2} out
- */
- function transpose(out, a) {
- // If we are transposing ourselves we can skip a few steps but have to cache
- // some values
- if (out === a) {
- var a1 = a[1];
- out[1] = a[2];
- out[2] = a1;
- } else {
- out[0] = a[0];
- out[1] = a[2];
- out[2] = a[1];
- out[3] = a[3];
- }
- return out;
- }
- /**
- * Inverts a mat2
- *
- * @param {mat2} out the receiving matrix
- * @param {ReadonlyMat2} a the source matrix
- * @returns {mat2} out
- */
- function invert(out, a) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2],
- a3 = a[3]; // Calculate the determinant
- var det = a0 * a3 - a2 * a1;
- if (!det) {
- return null;
- }
- det = 1.0 / det;
- out[0] = a3 * det;
- out[1] = -a1 * det;
- out[2] = -a2 * det;
- out[3] = a0 * det;
- return out;
- }
- /**
- * Calculates the adjugate of a mat2
- *
- * @param {mat2} out the receiving matrix
- * @param {ReadonlyMat2} a the source matrix
- * @returns {mat2} out
- */
- function adjoint(out, a) {
- // Caching this value is nessecary if out == a
- var a0 = a[0];
- out[0] = a[3];
- out[1] = -a[1];
- out[2] = -a[2];
- out[3] = a0;
- return out;
- }
- /**
- * Calculates the determinant of a mat2
- *
- * @param {ReadonlyMat2} a the source matrix
- * @returns {Number} determinant of a
- */
- function determinant(a) {
- return a[0] * a[3] - a[2] * a[1];
- }
- /**
- * Multiplies two mat2's
- *
- * @param {mat2} out the receiving matrix
- * @param {ReadonlyMat2} a the first operand
- * @param {ReadonlyMat2} b the second operand
- * @returns {mat2} out
- */
- function multiply(out, a, b) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2],
- a3 = a[3];
- var b0 = b[0],
- b1 = b[1],
- b2 = b[2],
- b3 = b[3];
- out[0] = a0 * b0 + a2 * b1;
- out[1] = a1 * b0 + a3 * b1;
- out[2] = a0 * b2 + a2 * b3;
- out[3] = a1 * b2 + a3 * b3;
- return out;
- }
- /**
- * Rotates a mat2 by the given angle
- *
- * @param {mat2} out the receiving matrix
- * @param {ReadonlyMat2} a the matrix to rotate
- * @param {Number} rad the angle to rotate the matrix by
- * @returns {mat2} out
- */
- function rotate(out, a, rad) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2],
- a3 = a[3];
- var s = Math.sin(rad);
- var c = Math.cos(rad);
- out[0] = a0 * c + a2 * s;
- out[1] = a1 * c + a3 * s;
- out[2] = a0 * -s + a2 * c;
- out[3] = a1 * -s + a3 * c;
- return out;
- }
- /**
- * Scales the mat2 by the dimensions in the given vec2
- *
- * @param {mat2} out the receiving matrix
- * @param {ReadonlyMat2} a the matrix to rotate
- * @param {ReadonlyVec2} v the vec2 to scale the matrix by
- * @returns {mat2} out
- **/
- function scale(out, a, v) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2],
- a3 = a[3];
- var v0 = v[0],
- v1 = v[1];
- out[0] = a0 * v0;
- out[1] = a1 * v0;
- out[2] = a2 * v1;
- out[3] = a3 * v1;
- return out;
- }
- /**
- * Creates a matrix from a given angle
- * This is equivalent to (but much faster than):
- *
- * mat2.identity(dest);
- * mat2.rotate(dest, dest, rad);
- *
- * @param {mat2} out mat2 receiving operation result
- * @param {Number} rad the angle to rotate the matrix by
- * @returns {mat2} out
- */
- function fromRotation(out, rad) {
- var s = Math.sin(rad);
- var c = Math.cos(rad);
- out[0] = c;
- out[1] = s;
- out[2] = -s;
- out[3] = c;
- return out;
- }
- /**
- * Creates a matrix from a vector scaling
- * This is equivalent to (but much faster than):
- *
- * mat2.identity(dest);
- * mat2.scale(dest, dest, vec);
- *
- * @param {mat2} out mat2 receiving operation result
- * @param {ReadonlyVec2} v Scaling vector
- * @returns {mat2} out
- */
- function fromScaling(out, v) {
- out[0] = v[0];
- out[1] = 0;
- out[2] = 0;
- out[3] = v[1];
- return out;
- }
- /**
- * Returns a string representation of a mat2
- *
- * @param {ReadonlyMat2} a matrix to represent as a string
- * @returns {String} string representation of the matrix
- */
- function str(a) {
- return "mat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")";
- }
- /**
- * Returns Frobenius norm of a mat2
- *
- * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of
- * @returns {Number} Frobenius norm
- */
- function frob(a) {
- return Math.hypot(a[0], a[1], a[2], a[3]);
- }
- /**
- * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix
- * @param {ReadonlyMat2} L the lower triangular matrix
- * @param {ReadonlyMat2} D the diagonal matrix
- * @param {ReadonlyMat2} U the upper triangular matrix
- * @param {ReadonlyMat2} a the input matrix to factorize
- */
- function LDU(L, D, U, a) {
- L[2] = a[2] / a[0];
- U[0] = a[0];
- U[1] = a[1];
- U[3] = a[3] - L[2] * U[1];
- return [L, D, U];
- }
- /**
- * Adds two mat2's
- *
- * @param {mat2} out the receiving matrix
- * @param {ReadonlyMat2} a the first operand
- * @param {ReadonlyMat2} b the second operand
- * @returns {mat2} out
- */
- function add(out, a, b) {
- out[0] = a[0] + b[0];
- out[1] = a[1] + b[1];
- out[2] = a[2] + b[2];
- out[3] = a[3] + b[3];
- return out;
- }
- /**
- * Subtracts matrix b from matrix a
- *
- * @param {mat2} out the receiving matrix
- * @param {ReadonlyMat2} a the first operand
- * @param {ReadonlyMat2} b the second operand
- * @returns {mat2} out
- */
- function subtract(out, a, b) {
- out[0] = a[0] - b[0];
- out[1] = a[1] - b[1];
- out[2] = a[2] - b[2];
- out[3] = a[3] - b[3];
- return out;
- }
- /**
- * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
- *
- * @param {ReadonlyMat2} a The first matrix.
- * @param {ReadonlyMat2} b The second matrix.
- * @returns {Boolean} True if the matrices are equal, false otherwise.
- */
- function exactEquals(a, b) {
- return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];
- }
- /**
- * Returns whether or not the matrices have approximately the same elements in the same position.
- *
- * @param {ReadonlyMat2} a The first matrix.
- * @param {ReadonlyMat2} b The second matrix.
- * @returns {Boolean} True if the matrices are equal, false otherwise.
- */
- function equals(a, b) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2],
- a3 = a[3];
- var b0 = b[0],
- b1 = b[1],
- b2 = b[2],
- b3 = b[3];
- return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a3), Math.abs(b3));
- }
- /**
- * Multiply each element of the matrix by a scalar.
- *
- * @param {mat2} out the receiving matrix
- * @param {ReadonlyMat2} a the matrix to scale
- * @param {Number} b amount to scale the matrix's elements by
- * @returns {mat2} out
- */
- function multiplyScalar(out, a, b) {
- out[0] = a[0] * b;
- out[1] = a[1] * b;
- out[2] = a[2] * b;
- out[3] = a[3] * b;
- return out;
- }
- /**
- * Adds two mat2's after multiplying each element of the second operand by a scalar value.
- *
- * @param {mat2} out the receiving vector
- * @param {ReadonlyMat2} a the first operand
- * @param {ReadonlyMat2} b the second operand
- * @param {Number} scale the amount to scale b's elements by before adding
- * @returns {mat2} out
- */
- function multiplyScalarAndAdd(out, a, b, scale) {
- out[0] = a[0] + b[0] * scale;
- out[1] = a[1] + b[1] * scale;
- out[2] = a[2] + b[2] * scale;
- out[3] = a[3] + b[3] * scale;
- return out;
- }
- /**
- * Alias for {@link mat2.multiply}
- * @function
- */
- var mul = multiply;
- /**
- * Alias for {@link mat2.subtract}
- * @function
- */
- var sub = subtract;
- /***/ }),
- /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat2d.js":
- /*!**************************************************************!*\
- !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat2d.js ***!
- \**************************************************************/
- /*! exports provided: create, clone, copy, identity, fromValues, set, invert, determinant, multiply, rotate, scale, translate, fromRotation, fromScaling, fromTranslation, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "determinant", function() { return determinant; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotate", function() { return rotate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "translate", function() { return translate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotation", function() { return fromRotation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromScaling", function() { return fromScaling; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromTranslation", function() { return fromTranslation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "frob", function() { return frob; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalar", function() { return multiplyScalar; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalarAndAdd", function() { return multiplyScalarAndAdd; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
- /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
- /**
- * 2x3 Matrix
- * @module mat2d
- * @description
- * A mat2d contains six elements defined as:
- * <pre>
- * [a, b,
- * c, d,
- * tx, ty]
- * </pre>
- * This is a short form for the 3x3 matrix:
- * <pre>
- * [a, b, 0,
- * c, d, 0,
- * tx, ty, 1]
- * </pre>
- * The last column is ignored so the array is shorter and operations are faster.
- */
- /**
- * Creates a new identity mat2d
- *
- * @returns {mat2d} a new 2x3 matrix
- */
- function create() {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](6);
- if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
- out[1] = 0;
- out[2] = 0;
- out[4] = 0;
- out[5] = 0;
- }
- out[0] = 1;
- out[3] = 1;
- return out;
- }
- /**
- * Creates a new mat2d initialized with values from an existing matrix
- *
- * @param {ReadonlyMat2d} a matrix to clone
- * @returns {mat2d} a new 2x3 matrix
- */
- function clone(a) {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](6);
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- out[4] = a[4];
- out[5] = a[5];
- return out;
- }
- /**
- * Copy the values from one mat2d to another
- *
- * @param {mat2d} out the receiving matrix
- * @param {ReadonlyMat2d} a the source matrix
- * @returns {mat2d} out
- */
- function copy(out, a) {
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- out[4] = a[4];
- out[5] = a[5];
- return out;
- }
- /**
- * Set a mat2d to the identity matrix
- *
- * @param {mat2d} out the receiving matrix
- * @returns {mat2d} out
- */
- function identity(out) {
- out[0] = 1;
- out[1] = 0;
- out[2] = 0;
- out[3] = 1;
- out[4] = 0;
- out[5] = 0;
- return out;
- }
- /**
- * Create a new mat2d with the given values
- *
- * @param {Number} a Component A (index 0)
- * @param {Number} b Component B (index 1)
- * @param {Number} c Component C (index 2)
- * @param {Number} d Component D (index 3)
- * @param {Number} tx Component TX (index 4)
- * @param {Number} ty Component TY (index 5)
- * @returns {mat2d} A new mat2d
- */
- function fromValues(a, b, c, d, tx, ty) {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](6);
- out[0] = a;
- out[1] = b;
- out[2] = c;
- out[3] = d;
- out[4] = tx;
- out[5] = ty;
- return out;
- }
- /**
- * Set the components of a mat2d to the given values
- *
- * @param {mat2d} out the receiving matrix
- * @param {Number} a Component A (index 0)
- * @param {Number} b Component B (index 1)
- * @param {Number} c Component C (index 2)
- * @param {Number} d Component D (index 3)
- * @param {Number} tx Component TX (index 4)
- * @param {Number} ty Component TY (index 5)
- * @returns {mat2d} out
- */
- function set(out, a, b, c, d, tx, ty) {
- out[0] = a;
- out[1] = b;
- out[2] = c;
- out[3] = d;
- out[4] = tx;
- out[5] = ty;
- return out;
- }
- /**
- * Inverts a mat2d
- *
- * @param {mat2d} out the receiving matrix
- * @param {ReadonlyMat2d} a the source matrix
- * @returns {mat2d} out
- */
- function invert(out, a) {
- var aa = a[0],
- ab = a[1],
- ac = a[2],
- ad = a[3];
- var atx = a[4],
- aty = a[5];
- var det = aa * ad - ab * ac;
- if (!det) {
- return null;
- }
- det = 1.0 / det;
- out[0] = ad * det;
- out[1] = -ab * det;
- out[2] = -ac * det;
- out[3] = aa * det;
- out[4] = (ac * aty - ad * atx) * det;
- out[5] = (ab * atx - aa * aty) * det;
- return out;
- }
- /**
- * Calculates the determinant of a mat2d
- *
- * @param {ReadonlyMat2d} a the source matrix
- * @returns {Number} determinant of a
- */
- function determinant(a) {
- return a[0] * a[3] - a[1] * a[2];
- }
- /**
- * Multiplies two mat2d's
- *
- * @param {mat2d} out the receiving matrix
- * @param {ReadonlyMat2d} a the first operand
- * @param {ReadonlyMat2d} b the second operand
- * @returns {mat2d} out
- */
- function multiply(out, a, b) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2],
- a3 = a[3],
- a4 = a[4],
- a5 = a[5];
- var b0 = b[0],
- b1 = b[1],
- b2 = b[2],
- b3 = b[3],
- b4 = b[4],
- b5 = b[5];
- out[0] = a0 * b0 + a2 * b1;
- out[1] = a1 * b0 + a3 * b1;
- out[2] = a0 * b2 + a2 * b3;
- out[3] = a1 * b2 + a3 * b3;
- out[4] = a0 * b4 + a2 * b5 + a4;
- out[5] = a1 * b4 + a3 * b5 + a5;
- return out;
- }
- /**
- * Rotates a mat2d by the given angle
- *
- * @param {mat2d} out the receiving matrix
- * @param {ReadonlyMat2d} a the matrix to rotate
- * @param {Number} rad the angle to rotate the matrix by
- * @returns {mat2d} out
- */
- function rotate(out, a, rad) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2],
- a3 = a[3],
- a4 = a[4],
- a5 = a[5];
- var s = Math.sin(rad);
- var c = Math.cos(rad);
- out[0] = a0 * c + a2 * s;
- out[1] = a1 * c + a3 * s;
- out[2] = a0 * -s + a2 * c;
- out[3] = a1 * -s + a3 * c;
- out[4] = a4;
- out[5] = a5;
- return out;
- }
- /**
- * Scales the mat2d by the dimensions in the given vec2
- *
- * @param {mat2d} out the receiving matrix
- * @param {ReadonlyMat2d} a the matrix to translate
- * @param {ReadonlyVec2} v the vec2 to scale the matrix by
- * @returns {mat2d} out
- **/
- function scale(out, a, v) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2],
- a3 = a[3],
- a4 = a[4],
- a5 = a[5];
- var v0 = v[0],
- v1 = v[1];
- out[0] = a0 * v0;
- out[1] = a1 * v0;
- out[2] = a2 * v1;
- out[3] = a3 * v1;
- out[4] = a4;
- out[5] = a5;
- return out;
- }
- /**
- * Translates the mat2d by the dimensions in the given vec2
- *
- * @param {mat2d} out the receiving matrix
- * @param {ReadonlyMat2d} a the matrix to translate
- * @param {ReadonlyVec2} v the vec2 to translate the matrix by
- * @returns {mat2d} out
- **/
- function translate(out, a, v) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2],
- a3 = a[3],
- a4 = a[4],
- a5 = a[5];
- var v0 = v[0],
- v1 = v[1];
- out[0] = a0;
- out[1] = a1;
- out[2] = a2;
- out[3] = a3;
- out[4] = a0 * v0 + a2 * v1 + a4;
- out[5] = a1 * v0 + a3 * v1 + a5;
- return out;
- }
- /**
- * Creates a matrix from a given angle
- * This is equivalent to (but much faster than):
- *
- * mat2d.identity(dest);
- * mat2d.rotate(dest, dest, rad);
- *
- * @param {mat2d} out mat2d receiving operation result
- * @param {Number} rad the angle to rotate the matrix by
- * @returns {mat2d} out
- */
- function fromRotation(out, rad) {
- var s = Math.sin(rad),
- c = Math.cos(rad);
- out[0] = c;
- out[1] = s;
- out[2] = -s;
- out[3] = c;
- out[4] = 0;
- out[5] = 0;
- return out;
- }
- /**
- * Creates a matrix from a vector scaling
- * This is equivalent to (but much faster than):
- *
- * mat2d.identity(dest);
- * mat2d.scale(dest, dest, vec);
- *
- * @param {mat2d} out mat2d receiving operation result
- * @param {ReadonlyVec2} v Scaling vector
- * @returns {mat2d} out
- */
- function fromScaling(out, v) {
- out[0] = v[0];
- out[1] = 0;
- out[2] = 0;
- out[3] = v[1];
- out[4] = 0;
- out[5] = 0;
- return out;
- }
- /**
- * Creates a matrix from a vector translation
- * This is equivalent to (but much faster than):
- *
- * mat2d.identity(dest);
- * mat2d.translate(dest, dest, vec);
- *
- * @param {mat2d} out mat2d receiving operation result
- * @param {ReadonlyVec2} v Translation vector
- * @returns {mat2d} out
- */
- function fromTranslation(out, v) {
- out[0] = 1;
- out[1] = 0;
- out[2] = 0;
- out[3] = 1;
- out[4] = v[0];
- out[5] = v[1];
- return out;
- }
- /**
- * Returns a string representation of a mat2d
- *
- * @param {ReadonlyMat2d} a matrix to represent as a string
- * @returns {String} string representation of the matrix
- */
- function str(a) {
- return "mat2d(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ")";
- }
- /**
- * Returns Frobenius norm of a mat2d
- *
- * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of
- * @returns {Number} Frobenius norm
- */
- function frob(a) {
- return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1);
- }
- /**
- * Adds two mat2d's
- *
- * @param {mat2d} out the receiving matrix
- * @param {ReadonlyMat2d} a the first operand
- * @param {ReadonlyMat2d} b the second operand
- * @returns {mat2d} out
- */
- function add(out, a, b) {
- out[0] = a[0] + b[0];
- out[1] = a[1] + b[1];
- out[2] = a[2] + b[2];
- out[3] = a[3] + b[3];
- out[4] = a[4] + b[4];
- out[5] = a[5] + b[5];
- return out;
- }
- /**
- * Subtracts matrix b from matrix a
- *
- * @param {mat2d} out the receiving matrix
- * @param {ReadonlyMat2d} a the first operand
- * @param {ReadonlyMat2d} b the second operand
- * @returns {mat2d} out
- */
- function subtract(out, a, b) {
- out[0] = a[0] - b[0];
- out[1] = a[1] - b[1];
- out[2] = a[2] - b[2];
- out[3] = a[3] - b[3];
- out[4] = a[4] - b[4];
- out[5] = a[5] - b[5];
- return out;
- }
- /**
- * Multiply each element of the matrix by a scalar.
- *
- * @param {mat2d} out the receiving matrix
- * @param {ReadonlyMat2d} a the matrix to scale
- * @param {Number} b amount to scale the matrix's elements by
- * @returns {mat2d} out
- */
- function multiplyScalar(out, a, b) {
- out[0] = a[0] * b;
- out[1] = a[1] * b;
- out[2] = a[2] * b;
- out[3] = a[3] * b;
- out[4] = a[4] * b;
- out[5] = a[5] * b;
- return out;
- }
- /**
- * Adds two mat2d's after multiplying each element of the second operand by a scalar value.
- *
- * @param {mat2d} out the receiving vector
- * @param {ReadonlyMat2d} a the first operand
- * @param {ReadonlyMat2d} b the second operand
- * @param {Number} scale the amount to scale b's elements by before adding
- * @returns {mat2d} out
- */
- function multiplyScalarAndAdd(out, a, b, scale) {
- out[0] = a[0] + b[0] * scale;
- out[1] = a[1] + b[1] * scale;
- out[2] = a[2] + b[2] * scale;
- out[3] = a[3] + b[3] * scale;
- out[4] = a[4] + b[4] * scale;
- out[5] = a[5] + b[5] * scale;
- return out;
- }
- /**
- * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
- *
- * @param {ReadonlyMat2d} a The first matrix.
- * @param {ReadonlyMat2d} b The second matrix.
- * @returns {Boolean} True if the matrices are equal, false otherwise.
- */
- function exactEquals(a, b) {
- return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];
- }
- /**
- * Returns whether or not the matrices have approximately the same elements in the same position.
- *
- * @param {ReadonlyMat2d} a The first matrix.
- * @param {ReadonlyMat2d} b The second matrix.
- * @returns {Boolean} True if the matrices are equal, false otherwise.
- */
- function equals(a, b) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2],
- a3 = a[3],
- a4 = a[4],
- a5 = a[5];
- var b0 = b[0],
- b1 = b[1],
- b2 = b[2],
- b3 = b[3],
- b4 = b[4],
- b5 = b[5];
- return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a5), Math.abs(b5));
- }
- /**
- * Alias for {@link mat2d.multiply}
- * @function
- */
- var mul = multiply;
- /**
- * Alias for {@link mat2d.subtract}
- * @function
- */
- var sub = subtract;
- /***/ }),
- /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat3.js":
- /*!*************************************************************!*\
- !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat3.js ***!
- \*************************************************************/
- /*! exports provided: create, fromMat4, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, rotate, scale, fromTranslation, fromRotation, fromScaling, fromMat2d, fromQuat, normalFromMat4, projection, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromMat4", function() { return fromMat4; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return transpose; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjoint", function() { return adjoint; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "determinant", function() { return determinant; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "translate", function() { return translate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotate", function() { return rotate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromTranslation", function() { return fromTranslation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotation", function() { return fromRotation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromScaling", function() { return fromScaling; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromMat2d", function() { return fromMat2d; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromQuat", function() { return fromQuat; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalFromMat4", function() { return normalFromMat4; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "projection", function() { return projection; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "frob", function() { return frob; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalar", function() { return multiplyScalar; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalarAndAdd", function() { return multiplyScalarAndAdd; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
- /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
- /**
- * 3x3 Matrix
- * @module mat3
- */
- /**
- * Creates a new identity mat3
- *
- * @returns {mat3} a new 3x3 matrix
- */
- function create() {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](9);
- if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
- out[1] = 0;
- out[2] = 0;
- out[3] = 0;
- out[5] = 0;
- out[6] = 0;
- out[7] = 0;
- }
- out[0] = 1;
- out[4] = 1;
- out[8] = 1;
- return out;
- }
- /**
- * Copies the upper-left 3x3 values into the given mat3.
- *
- * @param {mat3} out the receiving 3x3 matrix
- * @param {ReadonlyMat4} a the source 4x4 matrix
- * @returns {mat3} out
- */
- function fromMat4(out, a) {
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[4];
- out[4] = a[5];
- out[5] = a[6];
- out[6] = a[8];
- out[7] = a[9];
- out[8] = a[10];
- return out;
- }
- /**
- * Creates a new mat3 initialized with values from an existing matrix
- *
- * @param {ReadonlyMat3} a matrix to clone
- * @returns {mat3} a new 3x3 matrix
- */
- function clone(a) {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](9);
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- out[4] = a[4];
- out[5] = a[5];
- out[6] = a[6];
- out[7] = a[7];
- out[8] = a[8];
- return out;
- }
- /**
- * Copy the values from one mat3 to another
- *
- * @param {mat3} out the receiving matrix
- * @param {ReadonlyMat3} a the source matrix
- * @returns {mat3} out
- */
- function copy(out, a) {
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- out[4] = a[4];
- out[5] = a[5];
- out[6] = a[6];
- out[7] = a[7];
- out[8] = a[8];
- return out;
- }
- /**
- * Create a new mat3 with the given values
- *
- * @param {Number} m00 Component in column 0, row 0 position (index 0)
- * @param {Number} m01 Component in column 0, row 1 position (index 1)
- * @param {Number} m02 Component in column 0, row 2 position (index 2)
- * @param {Number} m10 Component in column 1, row 0 position (index 3)
- * @param {Number} m11 Component in column 1, row 1 position (index 4)
- * @param {Number} m12 Component in column 1, row 2 position (index 5)
- * @param {Number} m20 Component in column 2, row 0 position (index 6)
- * @param {Number} m21 Component in column 2, row 1 position (index 7)
- * @param {Number} m22 Component in column 2, row 2 position (index 8)
- * @returns {mat3} A new mat3
- */
- function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](9);
- out[0] = m00;
- out[1] = m01;
- out[2] = m02;
- out[3] = m10;
- out[4] = m11;
- out[5] = m12;
- out[6] = m20;
- out[7] = m21;
- out[8] = m22;
- return out;
- }
- /**
- * Set the components of a mat3 to the given values
- *
- * @param {mat3} out the receiving matrix
- * @param {Number} m00 Component in column 0, row 0 position (index 0)
- * @param {Number} m01 Component in column 0, row 1 position (index 1)
- * @param {Number} m02 Component in column 0, row 2 position (index 2)
- * @param {Number} m10 Component in column 1, row 0 position (index 3)
- * @param {Number} m11 Component in column 1, row 1 position (index 4)
- * @param {Number} m12 Component in column 1, row 2 position (index 5)
- * @param {Number} m20 Component in column 2, row 0 position (index 6)
- * @param {Number} m21 Component in column 2, row 1 position (index 7)
- * @param {Number} m22 Component in column 2, row 2 position (index 8)
- * @returns {mat3} out
- */
- function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {
- out[0] = m00;
- out[1] = m01;
- out[2] = m02;
- out[3] = m10;
- out[4] = m11;
- out[5] = m12;
- out[6] = m20;
- out[7] = m21;
- out[8] = m22;
- return out;
- }
- /**
- * Set a mat3 to the identity matrix
- *
- * @param {mat3} out the receiving matrix
- * @returns {mat3} out
- */
- function identity(out) {
- out[0] = 1;
- out[1] = 0;
- out[2] = 0;
- out[3] = 0;
- out[4] = 1;
- out[5] = 0;
- out[6] = 0;
- out[7] = 0;
- out[8] = 1;
- return out;
- }
- /**
- * Transpose the values of a mat3
- *
- * @param {mat3} out the receiving matrix
- * @param {ReadonlyMat3} a the source matrix
- * @returns {mat3} out
- */
- function transpose(out, a) {
- // If we are transposing ourselves we can skip a few steps but have to cache some values
- if (out === a) {
- var a01 = a[1],
- a02 = a[2],
- a12 = a[5];
- out[1] = a[3];
- out[2] = a[6];
- out[3] = a01;
- out[5] = a[7];
- out[6] = a02;
- out[7] = a12;
- } else {
- out[0] = a[0];
- out[1] = a[3];
- out[2] = a[6];
- out[3] = a[1];
- out[4] = a[4];
- out[5] = a[7];
- out[6] = a[2];
- out[7] = a[5];
- out[8] = a[8];
- }
- return out;
- }
- /**
- * Inverts a mat3
- *
- * @param {mat3} out the receiving matrix
- * @param {ReadonlyMat3} a the source matrix
- * @returns {mat3} out
- */
- function invert(out, a) {
- var a00 = a[0],
- a01 = a[1],
- a02 = a[2];
- var a10 = a[3],
- a11 = a[4],
- a12 = a[5];
- var a20 = a[6],
- a21 = a[7],
- a22 = a[8];
- var b01 = a22 * a11 - a12 * a21;
- var b11 = -a22 * a10 + a12 * a20;
- var b21 = a21 * a10 - a11 * a20; // Calculate the determinant
- var det = a00 * b01 + a01 * b11 + a02 * b21;
- if (!det) {
- return null;
- }
- det = 1.0 / det;
- out[0] = b01 * det;
- out[1] = (-a22 * a01 + a02 * a21) * det;
- out[2] = (a12 * a01 - a02 * a11) * det;
- out[3] = b11 * det;
- out[4] = (a22 * a00 - a02 * a20) * det;
- out[5] = (-a12 * a00 + a02 * a10) * det;
- out[6] = b21 * det;
- out[7] = (-a21 * a00 + a01 * a20) * det;
- out[8] = (a11 * a00 - a01 * a10) * det;
- return out;
- }
- /**
- * Calculates the adjugate of a mat3
- *
- * @param {mat3} out the receiving matrix
- * @param {ReadonlyMat3} a the source matrix
- * @returns {mat3} out
- */
- function adjoint(out, a) {
- var a00 = a[0],
- a01 = a[1],
- a02 = a[2];
- var a10 = a[3],
- a11 = a[4],
- a12 = a[5];
- var a20 = a[6],
- a21 = a[7],
- a22 = a[8];
- out[0] = a11 * a22 - a12 * a21;
- out[1] = a02 * a21 - a01 * a22;
- out[2] = a01 * a12 - a02 * a11;
- out[3] = a12 * a20 - a10 * a22;
- out[4] = a00 * a22 - a02 * a20;
- out[5] = a02 * a10 - a00 * a12;
- out[6] = a10 * a21 - a11 * a20;
- out[7] = a01 * a20 - a00 * a21;
- out[8] = a00 * a11 - a01 * a10;
- return out;
- }
- /**
- * Calculates the determinant of a mat3
- *
- * @param {ReadonlyMat3} a the source matrix
- * @returns {Number} determinant of a
- */
- function determinant(a) {
- var a00 = a[0],
- a01 = a[1],
- a02 = a[2];
- var a10 = a[3],
- a11 = a[4],
- a12 = a[5];
- var a20 = a[6],
- a21 = a[7],
- a22 = a[8];
- return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);
- }
- /**
- * Multiplies two mat3's
- *
- * @param {mat3} out the receiving matrix
- * @param {ReadonlyMat3} a the first operand
- * @param {ReadonlyMat3} b the second operand
- * @returns {mat3} out
- */
- function multiply(out, a, b) {
- var a00 = a[0],
- a01 = a[1],
- a02 = a[2];
- var a10 = a[3],
- a11 = a[4],
- a12 = a[5];
- var a20 = a[6],
- a21 = a[7],
- a22 = a[8];
- var b00 = b[0],
- b01 = b[1],
- b02 = b[2];
- var b10 = b[3],
- b11 = b[4],
- b12 = b[5];
- var b20 = b[6],
- b21 = b[7],
- b22 = b[8];
- out[0] = b00 * a00 + b01 * a10 + b02 * a20;
- out[1] = b00 * a01 + b01 * a11 + b02 * a21;
- out[2] = b00 * a02 + b01 * a12 + b02 * a22;
- out[3] = b10 * a00 + b11 * a10 + b12 * a20;
- out[4] = b10 * a01 + b11 * a11 + b12 * a21;
- out[5] = b10 * a02 + b11 * a12 + b12 * a22;
- out[6] = b20 * a00 + b21 * a10 + b22 * a20;
- out[7] = b20 * a01 + b21 * a11 + b22 * a21;
- out[8] = b20 * a02 + b21 * a12 + b22 * a22;
- return out;
- }
- /**
- * Translate a mat3 by the given vector
- *
- * @param {mat3} out the receiving matrix
- * @param {ReadonlyMat3} a the matrix to translate
- * @param {ReadonlyVec2} v vector to translate by
- * @returns {mat3} out
- */
- function translate(out, a, v) {
- var a00 = a[0],
- a01 = a[1],
- a02 = a[2],
- a10 = a[3],
- a11 = a[4],
- a12 = a[5],
- a20 = a[6],
- a21 = a[7],
- a22 = a[8],
- x = v[0],
- y = v[1];
- out[0] = a00;
- out[1] = a01;
- out[2] = a02;
- out[3] = a10;
- out[4] = a11;
- out[5] = a12;
- out[6] = x * a00 + y * a10 + a20;
- out[7] = x * a01 + y * a11 + a21;
- out[8] = x * a02 + y * a12 + a22;
- return out;
- }
- /**
- * Rotates a mat3 by the given angle
- *
- * @param {mat3} out the receiving matrix
- * @param {ReadonlyMat3} a the matrix to rotate
- * @param {Number} rad the angle to rotate the matrix by
- * @returns {mat3} out
- */
- function rotate(out, a, rad) {
- var a00 = a[0],
- a01 = a[1],
- a02 = a[2],
- a10 = a[3],
- a11 = a[4],
- a12 = a[5],
- a20 = a[6],
- a21 = a[7],
- a22 = a[8],
- s = Math.sin(rad),
- c = Math.cos(rad);
- out[0] = c * a00 + s * a10;
- out[1] = c * a01 + s * a11;
- out[2] = c * a02 + s * a12;
- out[3] = c * a10 - s * a00;
- out[4] = c * a11 - s * a01;
- out[5] = c * a12 - s * a02;
- out[6] = a20;
- out[7] = a21;
- out[8] = a22;
- return out;
- }
- /**
- * Scales the mat3 by the dimensions in the given vec2
- *
- * @param {mat3} out the receiving matrix
- * @param {ReadonlyMat3} a the matrix to rotate
- * @param {ReadonlyVec2} v the vec2 to scale the matrix by
- * @returns {mat3} out
- **/
- function scale(out, a, v) {
- var x = v[0],
- y = v[1];
- out[0] = x * a[0];
- out[1] = x * a[1];
- out[2] = x * a[2];
- out[3] = y * a[3];
- out[4] = y * a[4];
- out[5] = y * a[5];
- out[6] = a[6];
- out[7] = a[7];
- out[8] = a[8];
- return out;
- }
- /**
- * Creates a matrix from a vector translation
- * This is equivalent to (but much faster than):
- *
- * mat3.identity(dest);
- * mat3.translate(dest, dest, vec);
- *
- * @param {mat3} out mat3 receiving operation result
- * @param {ReadonlyVec2} v Translation vector
- * @returns {mat3} out
- */
- function fromTranslation(out, v) {
- out[0] = 1;
- out[1] = 0;
- out[2] = 0;
- out[3] = 0;
- out[4] = 1;
- out[5] = 0;
- out[6] = v[0];
- out[7] = v[1];
- out[8] = 1;
- return out;
- }
- /**
- * Creates a matrix from a given angle
- * This is equivalent to (but much faster than):
- *
- * mat3.identity(dest);
- * mat3.rotate(dest, dest, rad);
- *
- * @param {mat3} out mat3 receiving operation result
- * @param {Number} rad the angle to rotate the matrix by
- * @returns {mat3} out
- */
- function fromRotation(out, rad) {
- var s = Math.sin(rad),
- c = Math.cos(rad);
- out[0] = c;
- out[1] = s;
- out[2] = 0;
- out[3] = -s;
- out[4] = c;
- out[5] = 0;
- out[6] = 0;
- out[7] = 0;
- out[8] = 1;
- return out;
- }
- /**
- * Creates a matrix from a vector scaling
- * This is equivalent to (but much faster than):
- *
- * mat3.identity(dest);
- * mat3.scale(dest, dest, vec);
- *
- * @param {mat3} out mat3 receiving operation result
- * @param {ReadonlyVec2} v Scaling vector
- * @returns {mat3} out
- */
- function fromScaling(out, v) {
- out[0] = v[0];
- out[1] = 0;
- out[2] = 0;
- out[3] = 0;
- out[4] = v[1];
- out[5] = 0;
- out[6] = 0;
- out[7] = 0;
- out[8] = 1;
- return out;
- }
- /**
- * Copies the values from a mat2d into a mat3
- *
- * @param {mat3} out the receiving matrix
- * @param {ReadonlyMat2d} a the matrix to copy
- * @returns {mat3} out
- **/
- function fromMat2d(out, a) {
- out[0] = a[0];
- out[1] = a[1];
- out[2] = 0;
- out[3] = a[2];
- out[4] = a[3];
- out[5] = 0;
- out[6] = a[4];
- out[7] = a[5];
- out[8] = 1;
- return out;
- }
- /**
- * Calculates a 3x3 matrix from the given quaternion
- *
- * @param {mat3} out mat3 receiving operation result
- * @param {ReadonlyQuat} q Quaternion to create matrix from
- *
- * @returns {mat3} out
- */
- function fromQuat(out, q) {
- var x = q[0],
- y = q[1],
- z = q[2],
- w = q[3];
- var x2 = x + x;
- var y2 = y + y;
- var z2 = z + z;
- var xx = x * x2;
- var yx = y * x2;
- var yy = y * y2;
- var zx = z * x2;
- var zy = z * y2;
- var zz = z * z2;
- var wx = w * x2;
- var wy = w * y2;
- var wz = w * z2;
- out[0] = 1 - yy - zz;
- out[3] = yx - wz;
- out[6] = zx + wy;
- out[1] = yx + wz;
- out[4] = 1 - xx - zz;
- out[7] = zy - wx;
- out[2] = zx - wy;
- out[5] = zy + wx;
- out[8] = 1 - xx - yy;
- return out;
- }
- /**
- * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix
- *
- * @param {mat3} out mat3 receiving operation result
- * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from
- *
- * @returns {mat3} out
- */
- function normalFromMat4(out, a) {
- var a00 = a[0],
- a01 = a[1],
- a02 = a[2],
- a03 = a[3];
- var a10 = a[4],
- a11 = a[5],
- a12 = a[6],
- a13 = a[7];
- var a20 = a[8],
- a21 = a[9],
- a22 = a[10],
- a23 = a[11];
- var a30 = a[12],
- a31 = a[13],
- a32 = a[14],
- a33 = a[15];
- var b00 = a00 * a11 - a01 * a10;
- var b01 = a00 * a12 - a02 * a10;
- var b02 = a00 * a13 - a03 * a10;
- var b03 = a01 * a12 - a02 * a11;
- var b04 = a01 * a13 - a03 * a11;
- var b05 = a02 * a13 - a03 * a12;
- var b06 = a20 * a31 - a21 * a30;
- var b07 = a20 * a32 - a22 * a30;
- var b08 = a20 * a33 - a23 * a30;
- var b09 = a21 * a32 - a22 * a31;
- var b10 = a21 * a33 - a23 * a31;
- var b11 = a22 * a33 - a23 * a32; // Calculate the determinant
- var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;
- if (!det) {
- return null;
- }
- det = 1.0 / det;
- out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;
- out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;
- out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;
- out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;
- out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;
- out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;
- out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;
- out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;
- out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;
- return out;
- }
- /**
- * Generates a 2D projection matrix with the given bounds
- *
- * @param {mat3} out mat3 frustum matrix will be written into
- * @param {number} width Width of your gl context
- * @param {number} height Height of gl context
- * @returns {mat3} out
- */
- function projection(out, width, height) {
- out[0] = 2 / width;
- out[1] = 0;
- out[2] = 0;
- out[3] = 0;
- out[4] = -2 / height;
- out[5] = 0;
- out[6] = -1;
- out[7] = 1;
- out[8] = 1;
- return out;
- }
- /**
- * Returns a string representation of a mat3
- *
- * @param {ReadonlyMat3} a matrix to represent as a string
- * @returns {String} string representation of the matrix
- */
- function str(a) {
- return "mat3(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ")";
- }
- /**
- * Returns Frobenius norm of a mat3
- *
- * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of
- * @returns {Number} Frobenius norm
- */
- function frob(a) {
- return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);
- }
- /**
- * Adds two mat3's
- *
- * @param {mat3} out the receiving matrix
- * @param {ReadonlyMat3} a the first operand
- * @param {ReadonlyMat3} b the second operand
- * @returns {mat3} out
- */
- function add(out, a, b) {
- out[0] = a[0] + b[0];
- out[1] = a[1] + b[1];
- out[2] = a[2] + b[2];
- out[3] = a[3] + b[3];
- out[4] = a[4] + b[4];
- out[5] = a[5] + b[5];
- out[6] = a[6] + b[6];
- out[7] = a[7] + b[7];
- out[8] = a[8] + b[8];
- return out;
- }
- /**
- * Subtracts matrix b from matrix a
- *
- * @param {mat3} out the receiving matrix
- * @param {ReadonlyMat3} a the first operand
- * @param {ReadonlyMat3} b the second operand
- * @returns {mat3} out
- */
- function subtract(out, a, b) {
- out[0] = a[0] - b[0];
- out[1] = a[1] - b[1];
- out[2] = a[2] - b[2];
- out[3] = a[3] - b[3];
- out[4] = a[4] - b[4];
- out[5] = a[5] - b[5];
- out[6] = a[6] - b[6];
- out[7] = a[7] - b[7];
- out[8] = a[8] - b[8];
- return out;
- }
- /**
- * Multiply each element of the matrix by a scalar.
- *
- * @param {mat3} out the receiving matrix
- * @param {ReadonlyMat3} a the matrix to scale
- * @param {Number} b amount to scale the matrix's elements by
- * @returns {mat3} out
- */
- function multiplyScalar(out, a, b) {
- out[0] = a[0] * b;
- out[1] = a[1] * b;
- out[2] = a[2] * b;
- out[3] = a[3] * b;
- out[4] = a[4] * b;
- out[5] = a[5] * b;
- out[6] = a[6] * b;
- out[7] = a[7] * b;
- out[8] = a[8] * b;
- return out;
- }
- /**
- * Adds two mat3's after multiplying each element of the second operand by a scalar value.
- *
- * @param {mat3} out the receiving vector
- * @param {ReadonlyMat3} a the first operand
- * @param {ReadonlyMat3} b the second operand
- * @param {Number} scale the amount to scale b's elements by before adding
- * @returns {mat3} out
- */
- function multiplyScalarAndAdd(out, a, b, scale) {
- out[0] = a[0] + b[0] * scale;
- out[1] = a[1] + b[1] * scale;
- out[2] = a[2] + b[2] * scale;
- out[3] = a[3] + b[3] * scale;
- out[4] = a[4] + b[4] * scale;
- out[5] = a[5] + b[5] * scale;
- out[6] = a[6] + b[6] * scale;
- out[7] = a[7] + b[7] * scale;
- out[8] = a[8] + b[8] * scale;
- return out;
- }
- /**
- * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
- *
- * @param {ReadonlyMat3} a The first matrix.
- * @param {ReadonlyMat3} b The second matrix.
- * @returns {Boolean} True if the matrices are equal, false otherwise.
- */
- function exactEquals(a, b) {
- return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];
- }
- /**
- * Returns whether or not the matrices have approximately the same elements in the same position.
- *
- * @param {ReadonlyMat3} a The first matrix.
- * @param {ReadonlyMat3} b The second matrix.
- * @returns {Boolean} True if the matrices are equal, false otherwise.
- */
- function equals(a, b) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2],
- a3 = a[3],
- a4 = a[4],
- a5 = a[5],
- a6 = a[6],
- a7 = a[7],
- a8 = a[8];
- var b0 = b[0],
- b1 = b[1],
- b2 = b[2],
- b3 = b[3],
- b4 = b[4],
- b5 = b[5],
- b6 = b[6],
- b7 = b[7],
- b8 = b[8];
- return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a8), Math.abs(b8));
- }
- /**
- * Alias for {@link mat3.multiply}
- * @function
- */
- var mul = multiply;
- /**
- * Alias for {@link mat3.subtract}
- * @function
- */
- var sub = subtract;
- /***/ }),
- /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat4.js":
- /*!*************************************************************!*\
- !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat4.js ***!
- \*************************************************************/
- /*! exports provided: create, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, scale, rotate, rotateX, rotateY, rotateZ, fromTranslation, fromScaling, fromRotation, fromXRotation, fromYRotation, fromZRotation, fromRotationTranslation, fromQuat2, getTranslation, getScaling, getRotation, fromRotationTranslationScale, fromRotationTranslationScaleOrigin, fromQuat, frustum, perspective, perspectiveFromFieldOfView, ortho, lookAt, targetTo, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return transpose; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjoint", function() { return adjoint; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "determinant", function() { return determinant; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "translate", function() { return translate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotate", function() { return rotate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateX", function() { return rotateX; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateY", function() { return rotateY; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateZ", function() { return rotateZ; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromTranslation", function() { return fromTranslation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromScaling", function() { return fromScaling; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotation", function() { return fromRotation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromXRotation", function() { return fromXRotation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromYRotation", function() { return fromYRotation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromZRotation", function() { return fromZRotation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotationTranslation", function() { return fromRotationTranslation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromQuat2", function() { return fromQuat2; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTranslation", function() { return getTranslation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getScaling", function() { return getScaling; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRotation", function() { return getRotation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotationTranslationScale", function() { return fromRotationTranslationScale; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotationTranslationScaleOrigin", function() { return fromRotationTranslationScaleOrigin; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromQuat", function() { return fromQuat; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "frustum", function() { return frustum; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "perspective", function() { return perspective; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "perspectiveFromFieldOfView", function() { return perspectiveFromFieldOfView; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ortho", function() { return ortho; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lookAt", function() { return lookAt; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "targetTo", function() { return targetTo; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "frob", function() { return frob; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalar", function() { return multiplyScalar; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalarAndAdd", function() { return multiplyScalarAndAdd; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
- /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
- /**
- * 4x4 Matrix<br>Format: column-major, when typed out it looks like row-major<br>The matrices are being post multiplied.
- * @module mat4
- */
- /**
- * Creates a new identity mat4
- *
- * @returns {mat4} a new 4x4 matrix
- */
- function create() {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](16);
- if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
- out[1] = 0;
- out[2] = 0;
- out[3] = 0;
- out[4] = 0;
- out[6] = 0;
- out[7] = 0;
- out[8] = 0;
- out[9] = 0;
- out[11] = 0;
- out[12] = 0;
- out[13] = 0;
- out[14] = 0;
- }
- out[0] = 1;
- out[5] = 1;
- out[10] = 1;
- out[15] = 1;
- return out;
- }
- /**
- * Creates a new mat4 initialized with values from an existing matrix
- *
- * @param {ReadonlyMat4} a matrix to clone
- * @returns {mat4} a new 4x4 matrix
- */
- function clone(a) {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](16);
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- out[4] = a[4];
- out[5] = a[5];
- out[6] = a[6];
- out[7] = a[7];
- out[8] = a[8];
- out[9] = a[9];
- out[10] = a[10];
- out[11] = a[11];
- out[12] = a[12];
- out[13] = a[13];
- out[14] = a[14];
- out[15] = a[15];
- return out;
- }
- /**
- * Copy the values from one mat4 to another
- *
- * @param {mat4} out the receiving matrix
- * @param {ReadonlyMat4} a the source matrix
- * @returns {mat4} out
- */
- function copy(out, a) {
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- out[4] = a[4];
- out[5] = a[5];
- out[6] = a[6];
- out[7] = a[7];
- out[8] = a[8];
- out[9] = a[9];
- out[10] = a[10];
- out[11] = a[11];
- out[12] = a[12];
- out[13] = a[13];
- out[14] = a[14];
- out[15] = a[15];
- return out;
- }
- /**
- * Create a new mat4 with the given values
- *
- * @param {Number} m00 Component in column 0, row 0 position (index 0)
- * @param {Number} m01 Component in column 0, row 1 position (index 1)
- * @param {Number} m02 Component in column 0, row 2 position (index 2)
- * @param {Number} m03 Component in column 0, row 3 position (index 3)
- * @param {Number} m10 Component in column 1, row 0 position (index 4)
- * @param {Number} m11 Component in column 1, row 1 position (index 5)
- * @param {Number} m12 Component in column 1, row 2 position (index 6)
- * @param {Number} m13 Component in column 1, row 3 position (index 7)
- * @param {Number} m20 Component in column 2, row 0 position (index 8)
- * @param {Number} m21 Component in column 2, row 1 position (index 9)
- * @param {Number} m22 Component in column 2, row 2 position (index 10)
- * @param {Number} m23 Component in column 2, row 3 position (index 11)
- * @param {Number} m30 Component in column 3, row 0 position (index 12)
- * @param {Number} m31 Component in column 3, row 1 position (index 13)
- * @param {Number} m32 Component in column 3, row 2 position (index 14)
- * @param {Number} m33 Component in column 3, row 3 position (index 15)
- * @returns {mat4} A new mat4
- */
- function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](16);
- out[0] = m00;
- out[1] = m01;
- out[2] = m02;
- out[3] = m03;
- out[4] = m10;
- out[5] = m11;
- out[6] = m12;
- out[7] = m13;
- out[8] = m20;
- out[9] = m21;
- out[10] = m22;
- out[11] = m23;
- out[12] = m30;
- out[13] = m31;
- out[14] = m32;
- out[15] = m33;
- return out;
- }
- /**
- * Set the components of a mat4 to the given values
- *
- * @param {mat4} out the receiving matrix
- * @param {Number} m00 Component in column 0, row 0 position (index 0)
- * @param {Number} m01 Component in column 0, row 1 position (index 1)
- * @param {Number} m02 Component in column 0, row 2 position (index 2)
- * @param {Number} m03 Component in column 0, row 3 position (index 3)
- * @param {Number} m10 Component in column 1, row 0 position (index 4)
- * @param {Number} m11 Component in column 1, row 1 position (index 5)
- * @param {Number} m12 Component in column 1, row 2 position (index 6)
- * @param {Number} m13 Component in column 1, row 3 position (index 7)
- * @param {Number} m20 Component in column 2, row 0 position (index 8)
- * @param {Number} m21 Component in column 2, row 1 position (index 9)
- * @param {Number} m22 Component in column 2, row 2 position (index 10)
- * @param {Number} m23 Component in column 2, row 3 position (index 11)
- * @param {Number} m30 Component in column 3, row 0 position (index 12)
- * @param {Number} m31 Component in column 3, row 1 position (index 13)
- * @param {Number} m32 Component in column 3, row 2 position (index 14)
- * @param {Number} m33 Component in column 3, row 3 position (index 15)
- * @returns {mat4} out
- */
- function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {
- out[0] = m00;
- out[1] = m01;
- out[2] = m02;
- out[3] = m03;
- out[4] = m10;
- out[5] = m11;
- out[6] = m12;
- out[7] = m13;
- out[8] = m20;
- out[9] = m21;
- out[10] = m22;
- out[11] = m23;
- out[12] = m30;
- out[13] = m31;
- out[14] = m32;
- out[15] = m33;
- return out;
- }
- /**
- * Set a mat4 to the identity matrix
- *
- * @param {mat4} out the receiving matrix
- * @returns {mat4} out
- */
- function identity(out) {
- out[0] = 1;
- out[1] = 0;
- out[2] = 0;
- out[3] = 0;
- out[4] = 0;
- out[5] = 1;
- out[6] = 0;
- out[7] = 0;
- out[8] = 0;
- out[9] = 0;
- out[10] = 1;
- out[11] = 0;
- out[12] = 0;
- out[13] = 0;
- out[14] = 0;
- out[15] = 1;
- return out;
- }
- /**
- * Transpose the values of a mat4
- *
- * @param {mat4} out the receiving matrix
- * @param {ReadonlyMat4} a the source matrix
- * @returns {mat4} out
- */
- function transpose(out, a) {
- // If we are transposing ourselves we can skip a few steps but have to cache some values
- if (out === a) {
- var a01 = a[1],
- a02 = a[2],
- a03 = a[3];
- var a12 = a[6],
- a13 = a[7];
- var a23 = a[11];
- out[1] = a[4];
- out[2] = a[8];
- out[3] = a[12];
- out[4] = a01;
- out[6] = a[9];
- out[7] = a[13];
- out[8] = a02;
- out[9] = a12;
- out[11] = a[14];
- out[12] = a03;
- out[13] = a13;
- out[14] = a23;
- } else {
- out[0] = a[0];
- out[1] = a[4];
- out[2] = a[8];
- out[3] = a[12];
- out[4] = a[1];
- out[5] = a[5];
- out[6] = a[9];
- out[7] = a[13];
- out[8] = a[2];
- out[9] = a[6];
- out[10] = a[10];
- out[11] = a[14];
- out[12] = a[3];
- out[13] = a[7];
- out[14] = a[11];
- out[15] = a[15];
- }
- return out;
- }
- /**
- * Inverts a mat4
- *
- * @param {mat4} out the receiving matrix
- * @param {ReadonlyMat4} a the source matrix
- * @returns {mat4} out
- */
- function invert(out, a) {
- var a00 = a[0],
- a01 = a[1],
- a02 = a[2],
- a03 = a[3];
- var a10 = a[4],
- a11 = a[5],
- a12 = a[6],
- a13 = a[7];
- var a20 = a[8],
- a21 = a[9],
- a22 = a[10],
- a23 = a[11];
- var a30 = a[12],
- a31 = a[13],
- a32 = a[14],
- a33 = a[15];
- var b00 = a00 * a11 - a01 * a10;
- var b01 = a00 * a12 - a02 * a10;
- var b02 = a00 * a13 - a03 * a10;
- var b03 = a01 * a12 - a02 * a11;
- var b04 = a01 * a13 - a03 * a11;
- var b05 = a02 * a13 - a03 * a12;
- var b06 = a20 * a31 - a21 * a30;
- var b07 = a20 * a32 - a22 * a30;
- var b08 = a20 * a33 - a23 * a30;
- var b09 = a21 * a32 - a22 * a31;
- var b10 = a21 * a33 - a23 * a31;
- var b11 = a22 * a33 - a23 * a32; // Calculate the determinant
- var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;
- if (!det) {
- return null;
- }
- det = 1.0 / det;
- out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;
- out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;
- out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;
- out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;
- out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;
- out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;
- out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;
- out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;
- out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;
- out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;
- out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;
- out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;
- out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;
- out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;
- out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;
- out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;
- return out;
- }
- /**
- * Calculates the adjugate of a mat4
- *
- * @param {mat4} out the receiving matrix
- * @param {ReadonlyMat4} a the source matrix
- * @returns {mat4} out
- */
- function adjoint(out, a) {
- var a00 = a[0],
- a01 = a[1],
- a02 = a[2],
- a03 = a[3];
- var a10 = a[4],
- a11 = a[5],
- a12 = a[6],
- a13 = a[7];
- var a20 = a[8],
- a21 = a[9],
- a22 = a[10],
- a23 = a[11];
- var a30 = a[12],
- a31 = a[13],
- a32 = a[14],
- a33 = a[15];
- out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);
- out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));
- out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);
- out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));
- out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));
- out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);
- out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));
- out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);
- out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);
- out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));
- out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);
- out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));
- out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));
- out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);
- out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));
- out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);
- return out;
- }
- /**
- * Calculates the determinant of a mat4
- *
- * @param {ReadonlyMat4} a the source matrix
- * @returns {Number} determinant of a
- */
- function determinant(a) {
- var a00 = a[0],
- a01 = a[1],
- a02 = a[2],
- a03 = a[3];
- var a10 = a[4],
- a11 = a[5],
- a12 = a[6],
- a13 = a[7];
- var a20 = a[8],
- a21 = a[9],
- a22 = a[10],
- a23 = a[11];
- var a30 = a[12],
- a31 = a[13],
- a32 = a[14],
- a33 = a[15];
- var b00 = a00 * a11 - a01 * a10;
- var b01 = a00 * a12 - a02 * a10;
- var b02 = a00 * a13 - a03 * a10;
- var b03 = a01 * a12 - a02 * a11;
- var b04 = a01 * a13 - a03 * a11;
- var b05 = a02 * a13 - a03 * a12;
- var b06 = a20 * a31 - a21 * a30;
- var b07 = a20 * a32 - a22 * a30;
- var b08 = a20 * a33 - a23 * a30;
- var b09 = a21 * a32 - a22 * a31;
- var b10 = a21 * a33 - a23 * a31;
- var b11 = a22 * a33 - a23 * a32; // Calculate the determinant
- return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;
- }
- /**
- * Multiplies two mat4s
- *
- * @param {mat4} out the receiving matrix
- * @param {ReadonlyMat4} a the first operand
- * @param {ReadonlyMat4} b the second operand
- * @returns {mat4} out
- */
- function multiply(out, a, b) {
- var a00 = a[0],
- a01 = a[1],
- a02 = a[2],
- a03 = a[3];
- var a10 = a[4],
- a11 = a[5],
- a12 = a[6],
- a13 = a[7];
- var a20 = a[8],
- a21 = a[9],
- a22 = a[10],
- a23 = a[11];
- var a30 = a[12],
- a31 = a[13],
- a32 = a[14],
- a33 = a[15]; // Cache only the current line of the second matrix
- var b0 = b[0],
- b1 = b[1],
- b2 = b[2],
- b3 = b[3];
- out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
- out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
- out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
- out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
- b0 = b[4];
- b1 = b[5];
- b2 = b[6];
- b3 = b[7];
- out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
- out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
- out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
- out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
- b0 = b[8];
- b1 = b[9];
- b2 = b[10];
- b3 = b[11];
- out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
- out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
- out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
- out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
- b0 = b[12];
- b1 = b[13];
- b2 = b[14];
- b3 = b[15];
- out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
- out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
- out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
- out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
- return out;
- }
- /**
- * Translate a mat4 by the given vector
- *
- * @param {mat4} out the receiving matrix
- * @param {ReadonlyMat4} a the matrix to translate
- * @param {ReadonlyVec3} v vector to translate by
- * @returns {mat4} out
- */
- function translate(out, a, v) {
- var x = v[0],
- y = v[1],
- z = v[2];
- var a00, a01, a02, a03;
- var a10, a11, a12, a13;
- var a20, a21, a22, a23;
- if (a === out) {
- out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];
- out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];
- out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];
- out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];
- } else {
- a00 = a[0];
- a01 = a[1];
- a02 = a[2];
- a03 = a[3];
- a10 = a[4];
- a11 = a[5];
- a12 = a[6];
- a13 = a[7];
- a20 = a[8];
- a21 = a[9];
- a22 = a[10];
- a23 = a[11];
- out[0] = a00;
- out[1] = a01;
- out[2] = a02;
- out[3] = a03;
- out[4] = a10;
- out[5] = a11;
- out[6] = a12;
- out[7] = a13;
- out[8] = a20;
- out[9] = a21;
- out[10] = a22;
- out[11] = a23;
- out[12] = a00 * x + a10 * y + a20 * z + a[12];
- out[13] = a01 * x + a11 * y + a21 * z + a[13];
- out[14] = a02 * x + a12 * y + a22 * z + a[14];
- out[15] = a03 * x + a13 * y + a23 * z + a[15];
- }
- return out;
- }
- /**
- * Scales the mat4 by the dimensions in the given vec3 not using vectorization
- *
- * @param {mat4} out the receiving matrix
- * @param {ReadonlyMat4} a the matrix to scale
- * @param {ReadonlyVec3} v the vec3 to scale the matrix by
- * @returns {mat4} out
- **/
- function scale(out, a, v) {
- var x = v[0],
- y = v[1],
- z = v[2];
- out[0] = a[0] * x;
- out[1] = a[1] * x;
- out[2] = a[2] * x;
- out[3] = a[3] * x;
- out[4] = a[4] * y;
- out[5] = a[5] * y;
- out[6] = a[6] * y;
- out[7] = a[7] * y;
- out[8] = a[8] * z;
- out[9] = a[9] * z;
- out[10] = a[10] * z;
- out[11] = a[11] * z;
- out[12] = a[12];
- out[13] = a[13];
- out[14] = a[14];
- out[15] = a[15];
- return out;
- }
- /**
- * Rotates a mat4 by the given angle around the given axis
- *
- * @param {mat4} out the receiving matrix
- * @param {ReadonlyMat4} a the matrix to rotate
- * @param {Number} rad the angle to rotate the matrix by
- * @param {ReadonlyVec3} axis the axis to rotate around
- * @returns {mat4} out
- */
- function rotate(out, a, rad, axis) {
- var x = axis[0],
- y = axis[1],
- z = axis[2];
- var len = Math.hypot(x, y, z);
- var s, c, t;
- var a00, a01, a02, a03;
- var a10, a11, a12, a13;
- var a20, a21, a22, a23;
- var b00, b01, b02;
- var b10, b11, b12;
- var b20, b21, b22;
- if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
- return null;
- }
- len = 1 / len;
- x *= len;
- y *= len;
- z *= len;
- s = Math.sin(rad);
- c = Math.cos(rad);
- t = 1 - c;
- a00 = a[0];
- a01 = a[1];
- a02 = a[2];
- a03 = a[3];
- a10 = a[4];
- a11 = a[5];
- a12 = a[6];
- a13 = a[7];
- a20 = a[8];
- a21 = a[9];
- a22 = a[10];
- a23 = a[11]; // Construct the elements of the rotation matrix
- b00 = x * x * t + c;
- b01 = y * x * t + z * s;
- b02 = z * x * t - y * s;
- b10 = x * y * t - z * s;
- b11 = y * y * t + c;
- b12 = z * y * t + x * s;
- b20 = x * z * t + y * s;
- b21 = y * z * t - x * s;
- b22 = z * z * t + c; // Perform rotation-specific matrix multiplication
- out[0] = a00 * b00 + a10 * b01 + a20 * b02;
- out[1] = a01 * b00 + a11 * b01 + a21 * b02;
- out[2] = a02 * b00 + a12 * b01 + a22 * b02;
- out[3] = a03 * b00 + a13 * b01 + a23 * b02;
- out[4] = a00 * b10 + a10 * b11 + a20 * b12;
- out[5] = a01 * b10 + a11 * b11 + a21 * b12;
- out[6] = a02 * b10 + a12 * b11 + a22 * b12;
- out[7] = a03 * b10 + a13 * b11 + a23 * b12;
- out[8] = a00 * b20 + a10 * b21 + a20 * b22;
- out[9] = a01 * b20 + a11 * b21 + a21 * b22;
- out[10] = a02 * b20 + a12 * b21 + a22 * b22;
- out[11] = a03 * b20 + a13 * b21 + a23 * b22;
- if (a !== out) {
- // If the source and destination differ, copy the unchanged last row
- out[12] = a[12];
- out[13] = a[13];
- out[14] = a[14];
- out[15] = a[15];
- }
- return out;
- }
- /**
- * Rotates a matrix by the given angle around the X axis
- *
- * @param {mat4} out the receiving matrix
- * @param {ReadonlyMat4} a the matrix to rotate
- * @param {Number} rad the angle to rotate the matrix by
- * @returns {mat4} out
- */
- function rotateX(out, a, rad) {
- var s = Math.sin(rad);
- var c = Math.cos(rad);
- var a10 = a[4];
- var a11 = a[5];
- var a12 = a[6];
- var a13 = a[7];
- var a20 = a[8];
- var a21 = a[9];
- var a22 = a[10];
- var a23 = a[11];
- if (a !== out) {
- // If the source and destination differ, copy the unchanged rows
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- out[12] = a[12];
- out[13] = a[13];
- out[14] = a[14];
- out[15] = a[15];
- } // Perform axis-specific matrix multiplication
- out[4] = a10 * c + a20 * s;
- out[5] = a11 * c + a21 * s;
- out[6] = a12 * c + a22 * s;
- out[7] = a13 * c + a23 * s;
- out[8] = a20 * c - a10 * s;
- out[9] = a21 * c - a11 * s;
- out[10] = a22 * c - a12 * s;
- out[11] = a23 * c - a13 * s;
- return out;
- }
- /**
- * Rotates a matrix by the given angle around the Y axis
- *
- * @param {mat4} out the receiving matrix
- * @param {ReadonlyMat4} a the matrix to rotate
- * @param {Number} rad the angle to rotate the matrix by
- * @returns {mat4} out
- */
- function rotateY(out, a, rad) {
- var s = Math.sin(rad);
- var c = Math.cos(rad);
- var a00 = a[0];
- var a01 = a[1];
- var a02 = a[2];
- var a03 = a[3];
- var a20 = a[8];
- var a21 = a[9];
- var a22 = a[10];
- var a23 = a[11];
- if (a !== out) {
- // If the source and destination differ, copy the unchanged rows
- out[4] = a[4];
- out[5] = a[5];
- out[6] = a[6];
- out[7] = a[7];
- out[12] = a[12];
- out[13] = a[13];
- out[14] = a[14];
- out[15] = a[15];
- } // Perform axis-specific matrix multiplication
- out[0] = a00 * c - a20 * s;
- out[1] = a01 * c - a21 * s;
- out[2] = a02 * c - a22 * s;
- out[3] = a03 * c - a23 * s;
- out[8] = a00 * s + a20 * c;
- out[9] = a01 * s + a21 * c;
- out[10] = a02 * s + a22 * c;
- out[11] = a03 * s + a23 * c;
- return out;
- }
- /**
- * Rotates a matrix by the given angle around the Z axis
- *
- * @param {mat4} out the receiving matrix
- * @param {ReadonlyMat4} a the matrix to rotate
- * @param {Number} rad the angle to rotate the matrix by
- * @returns {mat4} out
- */
- function rotateZ(out, a, rad) {
- var s = Math.sin(rad);
- var c = Math.cos(rad);
- var a00 = a[0];
- var a01 = a[1];
- var a02 = a[2];
- var a03 = a[3];
- var a10 = a[4];
- var a11 = a[5];
- var a12 = a[6];
- var a13 = a[7];
- if (a !== out) {
- // If the source and destination differ, copy the unchanged last row
- out[8] = a[8];
- out[9] = a[9];
- out[10] = a[10];
- out[11] = a[11];
- out[12] = a[12];
- out[13] = a[13];
- out[14] = a[14];
- out[15] = a[15];
- } // Perform axis-specific matrix multiplication
- out[0] = a00 * c + a10 * s;
- out[1] = a01 * c + a11 * s;
- out[2] = a02 * c + a12 * s;
- out[3] = a03 * c + a13 * s;
- out[4] = a10 * c - a00 * s;
- out[5] = a11 * c - a01 * s;
- out[6] = a12 * c - a02 * s;
- out[7] = a13 * c - a03 * s;
- return out;
- }
- /**
- * Creates a matrix from a vector translation
- * This is equivalent to (but much faster than):
- *
- * mat4.identity(dest);
- * mat4.translate(dest, dest, vec);
- *
- * @param {mat4} out mat4 receiving operation result
- * @param {ReadonlyVec3} v Translation vector
- * @returns {mat4} out
- */
- function fromTranslation(out, v) {
- out[0] = 1;
- out[1] = 0;
- out[2] = 0;
- out[3] = 0;
- out[4] = 0;
- out[5] = 1;
- out[6] = 0;
- out[7] = 0;
- out[8] = 0;
- out[9] = 0;
- out[10] = 1;
- out[11] = 0;
- out[12] = v[0];
- out[13] = v[1];
- out[14] = v[2];
- out[15] = 1;
- return out;
- }
- /**
- * Creates a matrix from a vector scaling
- * This is equivalent to (but much faster than):
- *
- * mat4.identity(dest);
- * mat4.scale(dest, dest, vec);
- *
- * @param {mat4} out mat4 receiving operation result
- * @param {ReadonlyVec3} v Scaling vector
- * @returns {mat4} out
- */
- function fromScaling(out, v) {
- out[0] = v[0];
- out[1] = 0;
- out[2] = 0;
- out[3] = 0;
- out[4] = 0;
- out[5] = v[1];
- out[6] = 0;
- out[7] = 0;
- out[8] = 0;
- out[9] = 0;
- out[10] = v[2];
- out[11] = 0;
- out[12] = 0;
- out[13] = 0;
- out[14] = 0;
- out[15] = 1;
- return out;
- }
- /**
- * Creates a matrix from a given angle around a given axis
- * This is equivalent to (but much faster than):
- *
- * mat4.identity(dest);
- * mat4.rotate(dest, dest, rad, axis);
- *
- * @param {mat4} out mat4 receiving operation result
- * @param {Number} rad the angle to rotate the matrix by
- * @param {ReadonlyVec3} axis the axis to rotate around
- * @returns {mat4} out
- */
- function fromRotation(out, rad, axis) {
- var x = axis[0],
- y = axis[1],
- z = axis[2];
- var len = Math.hypot(x, y, z);
- var s, c, t;
- if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
- return null;
- }
- len = 1 / len;
- x *= len;
- y *= len;
- z *= len;
- s = Math.sin(rad);
- c = Math.cos(rad);
- t = 1 - c; // Perform rotation-specific matrix multiplication
- out[0] = x * x * t + c;
- out[1] = y * x * t + z * s;
- out[2] = z * x * t - y * s;
- out[3] = 0;
- out[4] = x * y * t - z * s;
- out[5] = y * y * t + c;
- out[6] = z * y * t + x * s;
- out[7] = 0;
- out[8] = x * z * t + y * s;
- out[9] = y * z * t - x * s;
- out[10] = z * z * t + c;
- out[11] = 0;
- out[12] = 0;
- out[13] = 0;
- out[14] = 0;
- out[15] = 1;
- return out;
- }
- /**
- * Creates a matrix from the given angle around the X axis
- * This is equivalent to (but much faster than):
- *
- * mat4.identity(dest);
- * mat4.rotateX(dest, dest, rad);
- *
- * @param {mat4} out mat4 receiving operation result
- * @param {Number} rad the angle to rotate the matrix by
- * @returns {mat4} out
- */
- function fromXRotation(out, rad) {
- var s = Math.sin(rad);
- var c = Math.cos(rad); // Perform axis-specific matrix multiplication
- out[0] = 1;
- out[1] = 0;
- out[2] = 0;
- out[3] = 0;
- out[4] = 0;
- out[5] = c;
- out[6] = s;
- out[7] = 0;
- out[8] = 0;
- out[9] = -s;
- out[10] = c;
- out[11] = 0;
- out[12] = 0;
- out[13] = 0;
- out[14] = 0;
- out[15] = 1;
- return out;
- }
- /**
- * Creates a matrix from the given angle around the Y axis
- * This is equivalent to (but much faster than):
- *
- * mat4.identity(dest);
- * mat4.rotateY(dest, dest, rad);
- *
- * @param {mat4} out mat4 receiving operation result
- * @param {Number} rad the angle to rotate the matrix by
- * @returns {mat4} out
- */
- function fromYRotation(out, rad) {
- var s = Math.sin(rad);
- var c = Math.cos(rad); // Perform axis-specific matrix multiplication
- out[0] = c;
- out[1] = 0;
- out[2] = -s;
- out[3] = 0;
- out[4] = 0;
- out[5] = 1;
- out[6] = 0;
- out[7] = 0;
- out[8] = s;
- out[9] = 0;
- out[10] = c;
- out[11] = 0;
- out[12] = 0;
- out[13] = 0;
- out[14] = 0;
- out[15] = 1;
- return out;
- }
- /**
- * Creates a matrix from the given angle around the Z axis
- * This is equivalent to (but much faster than):
- *
- * mat4.identity(dest);
- * mat4.rotateZ(dest, dest, rad);
- *
- * @param {mat4} out mat4 receiving operation result
- * @param {Number} rad the angle to rotate the matrix by
- * @returns {mat4} out
- */
- function fromZRotation(out, rad) {
- var s = Math.sin(rad);
- var c = Math.cos(rad); // Perform axis-specific matrix multiplication
- out[0] = c;
- out[1] = s;
- out[2] = 0;
- out[3] = 0;
- out[4] = -s;
- out[5] = c;
- out[6] = 0;
- out[7] = 0;
- out[8] = 0;
- out[9] = 0;
- out[10] = 1;
- out[11] = 0;
- out[12] = 0;
- out[13] = 0;
- out[14] = 0;
- out[15] = 1;
- return out;
- }
- /**
- * Creates a matrix from a quaternion rotation and vector translation
- * This is equivalent to (but much faster than):
- *
- * mat4.identity(dest);
- * mat4.translate(dest, vec);
- * let quatMat = mat4.create();
- * quat4.toMat4(quat, quatMat);
- * mat4.multiply(dest, quatMat);
- *
- * @param {mat4} out mat4 receiving operation result
- * @param {quat4} q Rotation quaternion
- * @param {ReadonlyVec3} v Translation vector
- * @returns {mat4} out
- */
- function fromRotationTranslation(out, q, v) {
- // Quaternion math
- var x = q[0],
- y = q[1],
- z = q[2],
- w = q[3];
- var x2 = x + x;
- var y2 = y + y;
- var z2 = z + z;
- var xx = x * x2;
- var xy = x * y2;
- var xz = x * z2;
- var yy = y * y2;
- var yz = y * z2;
- var zz = z * z2;
- var wx = w * x2;
- var wy = w * y2;
- var wz = w * z2;
- out[0] = 1 - (yy + zz);
- out[1] = xy + wz;
- out[2] = xz - wy;
- out[3] = 0;
- out[4] = xy - wz;
- out[5] = 1 - (xx + zz);
- out[6] = yz + wx;
- out[7] = 0;
- out[8] = xz + wy;
- out[9] = yz - wx;
- out[10] = 1 - (xx + yy);
- out[11] = 0;
- out[12] = v[0];
- out[13] = v[1];
- out[14] = v[2];
- out[15] = 1;
- return out;
- }
- /**
- * Creates a new mat4 from a dual quat.
- *
- * @param {mat4} out Matrix
- * @param {ReadonlyQuat2} a Dual Quaternion
- * @returns {mat4} mat4 receiving operation result
- */
- function fromQuat2(out, a) {
- var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
- var bx = -a[0],
- by = -a[1],
- bz = -a[2],
- bw = a[3],
- ax = a[4],
- ay = a[5],
- az = a[6],
- aw = a[7];
- var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense
- if (magnitude > 0) {
- translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;
- translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;
- translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;
- } else {
- translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;
- translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;
- translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;
- }
- fromRotationTranslation(out, a, translation);
- return out;
- }
- /**
- * Returns the translation vector component of a transformation
- * matrix. If a matrix is built with fromRotationTranslation,
- * the returned vector will be the same as the translation vector
- * originally supplied.
- * @param {vec3} out Vector to receive translation component
- * @param {ReadonlyMat4} mat Matrix to be decomposed (input)
- * @return {vec3} out
- */
- function getTranslation(out, mat) {
- out[0] = mat[12];
- out[1] = mat[13];
- out[2] = mat[14];
- return out;
- }
- /**
- * Returns the scaling factor component of a transformation
- * matrix. If a matrix is built with fromRotationTranslationScale
- * with a normalized Quaternion paramter, the returned vector will be
- * the same as the scaling vector
- * originally supplied.
- * @param {vec3} out Vector to receive scaling factor component
- * @param {ReadonlyMat4} mat Matrix to be decomposed (input)
- * @return {vec3} out
- */
- function getScaling(out, mat) {
- var m11 = mat[0];
- var m12 = mat[1];
- var m13 = mat[2];
- var m21 = mat[4];
- var m22 = mat[5];
- var m23 = mat[6];
- var m31 = mat[8];
- var m32 = mat[9];
- var m33 = mat[10];
- out[0] = Math.hypot(m11, m12, m13);
- out[1] = Math.hypot(m21, m22, m23);
- out[2] = Math.hypot(m31, m32, m33);
- return out;
- }
- /**
- * Returns a quaternion representing the rotational component
- * of a transformation matrix. If a matrix is built with
- * fromRotationTranslation, the returned quaternion will be the
- * same as the quaternion originally supplied.
- * @param {quat} out Quaternion to receive the rotation component
- * @param {ReadonlyMat4} mat Matrix to be decomposed (input)
- * @return {quat} out
- */
- function getRotation(out, mat) {
- var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
- getScaling(scaling, mat);
- var is1 = 1 / scaling[0];
- var is2 = 1 / scaling[1];
- var is3 = 1 / scaling[2];
- var sm11 = mat[0] * is1;
- var sm12 = mat[1] * is2;
- var sm13 = mat[2] * is3;
- var sm21 = mat[4] * is1;
- var sm22 = mat[5] * is2;
- var sm23 = mat[6] * is3;
- var sm31 = mat[8] * is1;
- var sm32 = mat[9] * is2;
- var sm33 = mat[10] * is3;
- var trace = sm11 + sm22 + sm33;
- var S = 0;
- if (trace > 0) {
- S = Math.sqrt(trace + 1.0) * 2;
- out[3] = 0.25 * S;
- out[0] = (sm23 - sm32) / S;
- out[1] = (sm31 - sm13) / S;
- out[2] = (sm12 - sm21) / S;
- } else if (sm11 > sm22 && sm11 > sm33) {
- S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;
- out[3] = (sm23 - sm32) / S;
- out[0] = 0.25 * S;
- out[1] = (sm12 + sm21) / S;
- out[2] = (sm31 + sm13) / S;
- } else if (sm22 > sm33) {
- S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;
- out[3] = (sm31 - sm13) / S;
- out[0] = (sm12 + sm21) / S;
- out[1] = 0.25 * S;
- out[2] = (sm23 + sm32) / S;
- } else {
- S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;
- out[3] = (sm12 - sm21) / S;
- out[0] = (sm31 + sm13) / S;
- out[1] = (sm23 + sm32) / S;
- out[2] = 0.25 * S;
- }
- return out;
- }
- /**
- * Creates a matrix from a quaternion rotation, vector translation and vector scale
- * This is equivalent to (but much faster than):
- *
- * mat4.identity(dest);
- * mat4.translate(dest, vec);
- * let quatMat = mat4.create();
- * quat4.toMat4(quat, quatMat);
- * mat4.multiply(dest, quatMat);
- * mat4.scale(dest, scale)
- *
- * @param {mat4} out mat4 receiving operation result
- * @param {quat4} q Rotation quaternion
- * @param {ReadonlyVec3} v Translation vector
- * @param {ReadonlyVec3} s Scaling vector
- * @returns {mat4} out
- */
- function fromRotationTranslationScale(out, q, v, s) {
- // Quaternion math
- var x = q[0],
- y = q[1],
- z = q[2],
- w = q[3];
- var x2 = x + x;
- var y2 = y + y;
- var z2 = z + z;
- var xx = x * x2;
- var xy = x * y2;
- var xz = x * z2;
- var yy = y * y2;
- var yz = y * z2;
- var zz = z * z2;
- var wx = w * x2;
- var wy = w * y2;
- var wz = w * z2;
- var sx = s[0];
- var sy = s[1];
- var sz = s[2];
- out[0] = (1 - (yy + zz)) * sx;
- out[1] = (xy + wz) * sx;
- out[2] = (xz - wy) * sx;
- out[3] = 0;
- out[4] = (xy - wz) * sy;
- out[5] = (1 - (xx + zz)) * sy;
- out[6] = (yz + wx) * sy;
- out[7] = 0;
- out[8] = (xz + wy) * sz;
- out[9] = (yz - wx) * sz;
- out[10] = (1 - (xx + yy)) * sz;
- out[11] = 0;
- out[12] = v[0];
- out[13] = v[1];
- out[14] = v[2];
- out[15] = 1;
- return out;
- }
- /**
- * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin
- * This is equivalent to (but much faster than):
- *
- * mat4.identity(dest);
- * mat4.translate(dest, vec);
- * mat4.translate(dest, origin);
- * let quatMat = mat4.create();
- * quat4.toMat4(quat, quatMat);
- * mat4.multiply(dest, quatMat);
- * mat4.scale(dest, scale)
- * mat4.translate(dest, negativeOrigin);
- *
- * @param {mat4} out mat4 receiving operation result
- * @param {quat4} q Rotation quaternion
- * @param {ReadonlyVec3} v Translation vector
- * @param {ReadonlyVec3} s Scaling vector
- * @param {ReadonlyVec3} o The origin vector around which to scale and rotate
- * @returns {mat4} out
- */
- function fromRotationTranslationScaleOrigin(out, q, v, s, o) {
- // Quaternion math
- var x = q[0],
- y = q[1],
- z = q[2],
- w = q[3];
- var x2 = x + x;
- var y2 = y + y;
- var z2 = z + z;
- var xx = x * x2;
- var xy = x * y2;
- var xz = x * z2;
- var yy = y * y2;
- var yz = y * z2;
- var zz = z * z2;
- var wx = w * x2;
- var wy = w * y2;
- var wz = w * z2;
- var sx = s[0];
- var sy = s[1];
- var sz = s[2];
- var ox = o[0];
- var oy = o[1];
- var oz = o[2];
- var out0 = (1 - (yy + zz)) * sx;
- var out1 = (xy + wz) * sx;
- var out2 = (xz - wy) * sx;
- var out4 = (xy - wz) * sy;
- var out5 = (1 - (xx + zz)) * sy;
- var out6 = (yz + wx) * sy;
- var out8 = (xz + wy) * sz;
- var out9 = (yz - wx) * sz;
- var out10 = (1 - (xx + yy)) * sz;
- out[0] = out0;
- out[1] = out1;
- out[2] = out2;
- out[3] = 0;
- out[4] = out4;
- out[5] = out5;
- out[6] = out6;
- out[7] = 0;
- out[8] = out8;
- out[9] = out9;
- out[10] = out10;
- out[11] = 0;
- out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);
- out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);
- out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);
- out[15] = 1;
- return out;
- }
- /**
- * Calculates a 4x4 matrix from the given quaternion
- *
- * @param {mat4} out mat4 receiving operation result
- * @param {ReadonlyQuat} q Quaternion to create matrix from
- *
- * @returns {mat4} out
- */
- function fromQuat(out, q) {
- var x = q[0],
- y = q[1],
- z = q[2],
- w = q[3];
- var x2 = x + x;
- var y2 = y + y;
- var z2 = z + z;
- var xx = x * x2;
- var yx = y * x2;
- var yy = y * y2;
- var zx = z * x2;
- var zy = z * y2;
- var zz = z * z2;
- var wx = w * x2;
- var wy = w * y2;
- var wz = w * z2;
- out[0] = 1 - yy - zz;
- out[1] = yx + wz;
- out[2] = zx - wy;
- out[3] = 0;
- out[4] = yx - wz;
- out[5] = 1 - xx - zz;
- out[6] = zy + wx;
- out[7] = 0;
- out[8] = zx + wy;
- out[9] = zy - wx;
- out[10] = 1 - xx - yy;
- out[11] = 0;
- out[12] = 0;
- out[13] = 0;
- out[14] = 0;
- out[15] = 1;
- return out;
- }
- /**
- * Generates a frustum matrix with the given bounds
- *
- * @param {mat4} out mat4 frustum matrix will be written into
- * @param {Number} left Left bound of the frustum
- * @param {Number} right Right bound of the frustum
- * @param {Number} bottom Bottom bound of the frustum
- * @param {Number} top Top bound of the frustum
- * @param {Number} near Near bound of the frustum
- * @param {Number} far Far bound of the frustum
- * @returns {mat4} out
- */
- function frustum(out, left, right, bottom, top, near, far) {
- var rl = 1 / (right - left);
- var tb = 1 / (top - bottom);
- var nf = 1 / (near - far);
- out[0] = near * 2 * rl;
- out[1] = 0;
- out[2] = 0;
- out[3] = 0;
- out[4] = 0;
- out[5] = near * 2 * tb;
- out[6] = 0;
- out[7] = 0;
- out[8] = (right + left) * rl;
- out[9] = (top + bottom) * tb;
- out[10] = (far + near) * nf;
- out[11] = -1;
- out[12] = 0;
- out[13] = 0;
- out[14] = far * near * 2 * nf;
- out[15] = 0;
- return out;
- }
- /**
- * Generates a perspective projection matrix with the given bounds.
- * Passing null/undefined/no value for far will generate infinite projection matrix.
- *
- * @param {mat4} out mat4 frustum matrix will be written into
- * @param {number} fovy Vertical field of view in radians
- * @param {number} aspect Aspect ratio. typically viewport width/height
- * @param {number} near Near bound of the frustum
- * @param {number} far Far bound of the frustum, can be null or Infinity
- * @returns {mat4} out
- */
- function perspective(out, fovy, aspect, near, far) {
- var f = 1.0 / Math.tan(fovy / 2),
- nf;
- out[0] = f / aspect;
- out[1] = 0;
- out[2] = 0;
- out[3] = 0;
- out[4] = 0;
- out[5] = f;
- out[6] = 0;
- out[7] = 0;
- out[8] = 0;
- out[9] = 0;
- out[11] = -1;
- out[12] = 0;
- out[13] = 0;
- out[15] = 0;
- if (far != null && far !== Infinity) {
- nf = 1 / (near - far);
- out[10] = (far + near) * nf;
- out[14] = 2 * far * near * nf;
- } else {
- out[10] = -1;
- out[14] = -2 * near;
- }
- return out;
- }
- /**
- * Generates a perspective projection matrix with the given field of view.
- * This is primarily useful for generating projection matrices to be used
- * with the still experiemental WebVR API.
- *
- * @param {mat4} out mat4 frustum matrix will be written into
- * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees
- * @param {number} near Near bound of the frustum
- * @param {number} far Far bound of the frustum
- * @returns {mat4} out
- */
- function perspectiveFromFieldOfView(out, fov, near, far) {
- var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);
- var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);
- var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);
- var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);
- var xScale = 2.0 / (leftTan + rightTan);
- var yScale = 2.0 / (upTan + downTan);
- out[0] = xScale;
- out[1] = 0.0;
- out[2] = 0.0;
- out[3] = 0.0;
- out[4] = 0.0;
- out[5] = yScale;
- out[6] = 0.0;
- out[7] = 0.0;
- out[8] = -((leftTan - rightTan) * xScale * 0.5);
- out[9] = (upTan - downTan) * yScale * 0.5;
- out[10] = far / (near - far);
- out[11] = -1.0;
- out[12] = 0.0;
- out[13] = 0.0;
- out[14] = far * near / (near - far);
- out[15] = 0.0;
- return out;
- }
- /**
- * Generates a orthogonal projection matrix with the given bounds
- *
- * @param {mat4} out mat4 frustum matrix will be written into
- * @param {number} left Left bound of the frustum
- * @param {number} right Right bound of the frustum
- * @param {number} bottom Bottom bound of the frustum
- * @param {number} top Top bound of the frustum
- * @param {number} near Near bound of the frustum
- * @param {number} far Far bound of the frustum
- * @returns {mat4} out
- */
- function ortho(out, left, right, bottom, top, near, far) {
- var lr = 1 / (left - right);
- var bt = 1 / (bottom - top);
- var nf = 1 / (near - far);
- out[0] = -2 * lr;
- out[1] = 0;
- out[2] = 0;
- out[3] = 0;
- out[4] = 0;
- out[5] = -2 * bt;
- out[6] = 0;
- out[7] = 0;
- out[8] = 0;
- out[9] = 0;
- out[10] = 2 * nf;
- out[11] = 0;
- out[12] = (left + right) * lr;
- out[13] = (top + bottom) * bt;
- out[14] = (far + near) * nf;
- out[15] = 1;
- return out;
- }
- /**
- * Generates a look-at matrix with the given eye position, focal point, and up axis.
- * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.
- *
- * @param {mat4} out mat4 frustum matrix will be written into
- * @param {ReadonlyVec3} eye Position of the viewer
- * @param {ReadonlyVec3} center Point the viewer is looking at
- * @param {ReadonlyVec3} up vec3 pointing up
- * @returns {mat4} out
- */
- function lookAt(out, eye, center, up) {
- var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;
- var eyex = eye[0];
- var eyey = eye[1];
- var eyez = eye[2];
- var upx = up[0];
- var upy = up[1];
- var upz = up[2];
- var centerx = center[0];
- var centery = center[1];
- var centerz = center[2];
- if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
- return identity(out);
- }
- z0 = eyex - centerx;
- z1 = eyey - centery;
- z2 = eyez - centerz;
- len = 1 / Math.hypot(z0, z1, z2);
- z0 *= len;
- z1 *= len;
- z2 *= len;
- x0 = upy * z2 - upz * z1;
- x1 = upz * z0 - upx * z2;
- x2 = upx * z1 - upy * z0;
- len = Math.hypot(x0, x1, x2);
- if (!len) {
- x0 = 0;
- x1 = 0;
- x2 = 0;
- } else {
- len = 1 / len;
- x0 *= len;
- x1 *= len;
- x2 *= len;
- }
- y0 = z1 * x2 - z2 * x1;
- y1 = z2 * x0 - z0 * x2;
- y2 = z0 * x1 - z1 * x0;
- len = Math.hypot(y0, y1, y2);
- if (!len) {
- y0 = 0;
- y1 = 0;
- y2 = 0;
- } else {
- len = 1 / len;
- y0 *= len;
- y1 *= len;
- y2 *= len;
- }
- out[0] = x0;
- out[1] = y0;
- out[2] = z0;
- out[3] = 0;
- out[4] = x1;
- out[5] = y1;
- out[6] = z1;
- out[7] = 0;
- out[8] = x2;
- out[9] = y2;
- out[10] = z2;
- out[11] = 0;
- out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);
- out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);
- out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);
- out[15] = 1;
- return out;
- }
- /**
- * Generates a matrix that makes something look at something else.
- *
- * @param {mat4} out mat4 frustum matrix will be written into
- * @param {ReadonlyVec3} eye Position of the viewer
- * @param {ReadonlyVec3} center Point the viewer is looking at
- * @param {ReadonlyVec3} up vec3 pointing up
- * @returns {mat4} out
- */
- function targetTo(out, eye, target, up) {
- var eyex = eye[0],
- eyey = eye[1],
- eyez = eye[2],
- upx = up[0],
- upy = up[1],
- upz = up[2];
- var z0 = eyex - target[0],
- z1 = eyey - target[1],
- z2 = eyez - target[2];
- var len = z0 * z0 + z1 * z1 + z2 * z2;
- if (len > 0) {
- len = 1 / Math.sqrt(len);
- z0 *= len;
- z1 *= len;
- z2 *= len;
- }
- var x0 = upy * z2 - upz * z1,
- x1 = upz * z0 - upx * z2,
- x2 = upx * z1 - upy * z0;
- len = x0 * x0 + x1 * x1 + x2 * x2;
- if (len > 0) {
- len = 1 / Math.sqrt(len);
- x0 *= len;
- x1 *= len;
- x2 *= len;
- }
- out[0] = x0;
- out[1] = x1;
- out[2] = x2;
- out[3] = 0;
- out[4] = z1 * x2 - z2 * x1;
- out[5] = z2 * x0 - z0 * x2;
- out[6] = z0 * x1 - z1 * x0;
- out[7] = 0;
- out[8] = z0;
- out[9] = z1;
- out[10] = z2;
- out[11] = 0;
- out[12] = eyex;
- out[13] = eyey;
- out[14] = eyez;
- out[15] = 1;
- return out;
- }
- /**
- * Returns a string representation of a mat4
- *
- * @param {ReadonlyMat4} a matrix to represent as a string
- * @returns {String} string representation of the matrix
- */
- function str(a) {
- return "mat4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ", " + a[9] + ", " + a[10] + ", " + a[11] + ", " + a[12] + ", " + a[13] + ", " + a[14] + ", " + a[15] + ")";
- }
- /**
- * Returns Frobenius norm of a mat4
- *
- * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of
- * @returns {Number} Frobenius norm
- */
- function frob(a) {
- return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);
- }
- /**
- * Adds two mat4's
- *
- * @param {mat4} out the receiving matrix
- * @param {ReadonlyMat4} a the first operand
- * @param {ReadonlyMat4} b the second operand
- * @returns {mat4} out
- */
- function add(out, a, b) {
- out[0] = a[0] + b[0];
- out[1] = a[1] + b[1];
- out[2] = a[2] + b[2];
- out[3] = a[3] + b[3];
- out[4] = a[4] + b[4];
- out[5] = a[5] + b[5];
- out[6] = a[6] + b[6];
- out[7] = a[7] + b[7];
- out[8] = a[8] + b[8];
- out[9] = a[9] + b[9];
- out[10] = a[10] + b[10];
- out[11] = a[11] + b[11];
- out[12] = a[12] + b[12];
- out[13] = a[13] + b[13];
- out[14] = a[14] + b[14];
- out[15] = a[15] + b[15];
- return out;
- }
- /**
- * Subtracts matrix b from matrix a
- *
- * @param {mat4} out the receiving matrix
- * @param {ReadonlyMat4} a the first operand
- * @param {ReadonlyMat4} b the second operand
- * @returns {mat4} out
- */
- function subtract(out, a, b) {
- out[0] = a[0] - b[0];
- out[1] = a[1] - b[1];
- out[2] = a[2] - b[2];
- out[3] = a[3] - b[3];
- out[4] = a[4] - b[4];
- out[5] = a[5] - b[5];
- out[6] = a[6] - b[6];
- out[7] = a[7] - b[7];
- out[8] = a[8] - b[8];
- out[9] = a[9] - b[9];
- out[10] = a[10] - b[10];
- out[11] = a[11] - b[11];
- out[12] = a[12] - b[12];
- out[13] = a[13] - b[13];
- out[14] = a[14] - b[14];
- out[15] = a[15] - b[15];
- return out;
- }
- /**
- * Multiply each element of the matrix by a scalar.
- *
- * @param {mat4} out the receiving matrix
- * @param {ReadonlyMat4} a the matrix to scale
- * @param {Number} b amount to scale the matrix's elements by
- * @returns {mat4} out
- */
- function multiplyScalar(out, a, b) {
- out[0] = a[0] * b;
- out[1] = a[1] * b;
- out[2] = a[2] * b;
- out[3] = a[3] * b;
- out[4] = a[4] * b;
- out[5] = a[5] * b;
- out[6] = a[6] * b;
- out[7] = a[7] * b;
- out[8] = a[8] * b;
- out[9] = a[9] * b;
- out[10] = a[10] * b;
- out[11] = a[11] * b;
- out[12] = a[12] * b;
- out[13] = a[13] * b;
- out[14] = a[14] * b;
- out[15] = a[15] * b;
- return out;
- }
- /**
- * Adds two mat4's after multiplying each element of the second operand by a scalar value.
- *
- * @param {mat4} out the receiving vector
- * @param {ReadonlyMat4} a the first operand
- * @param {ReadonlyMat4} b the second operand
- * @param {Number} scale the amount to scale b's elements by before adding
- * @returns {mat4} out
- */
- function multiplyScalarAndAdd(out, a, b, scale) {
- out[0] = a[0] + b[0] * scale;
- out[1] = a[1] + b[1] * scale;
- out[2] = a[2] + b[2] * scale;
- out[3] = a[3] + b[3] * scale;
- out[4] = a[4] + b[4] * scale;
- out[5] = a[5] + b[5] * scale;
- out[6] = a[6] + b[6] * scale;
- out[7] = a[7] + b[7] * scale;
- out[8] = a[8] + b[8] * scale;
- out[9] = a[9] + b[9] * scale;
- out[10] = a[10] + b[10] * scale;
- out[11] = a[11] + b[11] * scale;
- out[12] = a[12] + b[12] * scale;
- out[13] = a[13] + b[13] * scale;
- out[14] = a[14] + b[14] * scale;
- out[15] = a[15] + b[15] * scale;
- return out;
- }
- /**
- * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
- *
- * @param {ReadonlyMat4} a The first matrix.
- * @param {ReadonlyMat4} b The second matrix.
- * @returns {Boolean} True if the matrices are equal, false otherwise.
- */
- function exactEquals(a, b) {
- return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];
- }
- /**
- * Returns whether or not the matrices have approximately the same elements in the same position.
- *
- * @param {ReadonlyMat4} a The first matrix.
- * @param {ReadonlyMat4} b The second matrix.
- * @returns {Boolean} True if the matrices are equal, false otherwise.
- */
- function equals(a, b) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2],
- a3 = a[3];
- var a4 = a[4],
- a5 = a[5],
- a6 = a[6],
- a7 = a[7];
- var a8 = a[8],
- a9 = a[9],
- a10 = a[10],
- a11 = a[11];
- var a12 = a[12],
- a13 = a[13],
- a14 = a[14],
- a15 = a[15];
- var b0 = b[0],
- b1 = b[1],
- b2 = b[2],
- b3 = b[3];
- var b4 = b[4],
- b5 = b[5],
- b6 = b[6],
- b7 = b[7];
- var b8 = b[8],
- b9 = b[9],
- b10 = b[10],
- b11 = b[11];
- var b12 = b[12],
- b13 = b[13],
- b14 = b[14],
- b15 = b[15];
- return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a15), Math.abs(b15));
- }
- /**
- * Alias for {@link mat4.multiply}
- * @function
- */
- var mul = multiply;
- /**
- * Alias for {@link mat4.subtract}
- * @function
- */
- var sub = subtract;
- /***/ }),
- /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/quat.js":
- /*!*************************************************************!*\
- !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/quat.js ***!
- \*************************************************************/
- /*! exports provided: create, identity, setAxisAngle, getAxisAngle, getAngle, multiply, rotateX, rotateY, rotateZ, calculateW, exp, ln, pow, slerp, random, invert, conjugate, fromMat3, fromEuler, str, clone, fromValues, copy, set, add, mul, scale, dot, lerp, length, len, squaredLength, sqrLen, normalize, exactEquals, equals, rotationTo, sqlerp, setAxes */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAxisAngle", function() { return setAxisAngle; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAxisAngle", function() { return getAxisAngle; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAngle", function() { return getAngle; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateX", function() { return rotateX; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateY", function() { return rotateY; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateZ", function() { return rotateZ; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateW", function() { return calculateW; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exp", function() { return exp; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ln", function() { return ln; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pow", function() { return pow; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slerp", function() { return slerp; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return random; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conjugate", function() { return conjugate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromMat3", function() { return fromMat3; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromEuler", function() { return fromEuler; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return dot; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return lerp; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "length", function() { return length; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "len", function() { return len; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredLength", function() { return squaredLength; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrLen", function() { return sqrLen; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotationTo", function() { return rotationTo; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqlerp", function() { return sqlerp; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAxes", function() { return setAxes; });
- /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
- /* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mat3.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat3.js");
- /* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./vec3.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec3.js");
- /* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./vec4.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec4.js");
- /**
- * Quaternion
- * @module quat
- */
- /**
- * Creates a new identity quat
- *
- * @returns {quat} a new quaternion
- */
- function create() {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
- if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
- out[0] = 0;
- out[1] = 0;
- out[2] = 0;
- }
- out[3] = 1;
- return out;
- }
- /**
- * Set a quat to the identity quaternion
- *
- * @param {quat} out the receiving quaternion
- * @returns {quat} out
- */
- function identity(out) {
- out[0] = 0;
- out[1] = 0;
- out[2] = 0;
- out[3] = 1;
- return out;
- }
- /**
- * Sets a quat from the given angle and rotation axis,
- * then returns it.
- *
- * @param {quat} out the receiving quaternion
- * @param {ReadonlyVec3} axis the axis around which to rotate
- * @param {Number} rad the angle in radians
- * @returns {quat} out
- **/
- function setAxisAngle(out, axis, rad) {
- rad = rad * 0.5;
- var s = Math.sin(rad);
- out[0] = s * axis[0];
- out[1] = s * axis[1];
- out[2] = s * axis[2];
- out[3] = Math.cos(rad);
- return out;
- }
- /**
- * Gets the rotation axis and angle for a given
- * quaternion. If a quaternion is created with
- * setAxisAngle, this method will return the same
- * values as providied in the original parameter list
- * OR functionally equivalent values.
- * Example: The quaternion formed by axis [0, 0, 1] and
- * angle -90 is the same as the quaternion formed by
- * [0, 0, 1] and 270. This method favors the latter.
- * @param {vec3} out_axis Vector receiving the axis of rotation
- * @param {ReadonlyQuat} q Quaternion to be decomposed
- * @return {Number} Angle, in radians, of the rotation
- */
- function getAxisAngle(out_axis, q) {
- var rad = Math.acos(q[3]) * 2.0;
- var s = Math.sin(rad / 2.0);
- if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
- out_axis[0] = q[0] / s;
- out_axis[1] = q[1] / s;
- out_axis[2] = q[2] / s;
- } else {
- // If s is zero, return any axis (no rotation - axis does not matter)
- out_axis[0] = 1;
- out_axis[1] = 0;
- out_axis[2] = 0;
- }
- return rad;
- }
- /**
- * Gets the angular distance between two unit quaternions
- *
- * @param {ReadonlyQuat} a Origin unit quaternion
- * @param {ReadonlyQuat} b Destination unit quaternion
- * @return {Number} Angle, in radians, between the two quaternions
- */
- function getAngle(a, b) {
- var dotproduct = dot(a, b);
- return Math.acos(2 * dotproduct * dotproduct - 1);
- }
- /**
- * Multiplies two quat's
- *
- * @param {quat} out the receiving quaternion
- * @param {ReadonlyQuat} a the first operand
- * @param {ReadonlyQuat} b the second operand
- * @returns {quat} out
- */
- function multiply(out, a, b) {
- var ax = a[0],
- ay = a[1],
- az = a[2],
- aw = a[3];
- var bx = b[0],
- by = b[1],
- bz = b[2],
- bw = b[3];
- out[0] = ax * bw + aw * bx + ay * bz - az * by;
- out[1] = ay * bw + aw * by + az * bx - ax * bz;
- out[2] = az * bw + aw * bz + ax * by - ay * bx;
- out[3] = aw * bw - ax * bx - ay * by - az * bz;
- return out;
- }
- /**
- * Rotates a quaternion by the given angle about the X axis
- *
- * @param {quat} out quat receiving operation result
- * @param {ReadonlyQuat} a quat to rotate
- * @param {number} rad angle (in radians) to rotate
- * @returns {quat} out
- */
- function rotateX(out, a, rad) {
- rad *= 0.5;
- var ax = a[0],
- ay = a[1],
- az = a[2],
- aw = a[3];
- var bx = Math.sin(rad),
- bw = Math.cos(rad);
- out[0] = ax * bw + aw * bx;
- out[1] = ay * bw + az * bx;
- out[2] = az * bw - ay * bx;
- out[3] = aw * bw - ax * bx;
- return out;
- }
- /**
- * Rotates a quaternion by the given angle about the Y axis
- *
- * @param {quat} out quat receiving operation result
- * @param {ReadonlyQuat} a quat to rotate
- * @param {number} rad angle (in radians) to rotate
- * @returns {quat} out
- */
- function rotateY(out, a, rad) {
- rad *= 0.5;
- var ax = a[0],
- ay = a[1],
- az = a[2],
- aw = a[3];
- var by = Math.sin(rad),
- bw = Math.cos(rad);
- out[0] = ax * bw - az * by;
- out[1] = ay * bw + aw * by;
- out[2] = az * bw + ax * by;
- out[3] = aw * bw - ay * by;
- return out;
- }
- /**
- * Rotates a quaternion by the given angle about the Z axis
- *
- * @param {quat} out quat receiving operation result
- * @param {ReadonlyQuat} a quat to rotate
- * @param {number} rad angle (in radians) to rotate
- * @returns {quat} out
- */
- function rotateZ(out, a, rad) {
- rad *= 0.5;
- var ax = a[0],
- ay = a[1],
- az = a[2],
- aw = a[3];
- var bz = Math.sin(rad),
- bw = Math.cos(rad);
- out[0] = ax * bw + ay * bz;
- out[1] = ay * bw - ax * bz;
- out[2] = az * bw + aw * bz;
- out[3] = aw * bw - az * bz;
- return out;
- }
- /**
- * Calculates the W component of a quat from the X, Y, and Z components.
- * Assumes that quaternion is 1 unit in length.
- * Any existing W component will be ignored.
- *
- * @param {quat} out the receiving quaternion
- * @param {ReadonlyQuat} a quat to calculate W component of
- * @returns {quat} out
- */
- function calculateW(out, a) {
- var x = a[0],
- y = a[1],
- z = a[2];
- out[0] = x;
- out[1] = y;
- out[2] = z;
- out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));
- return out;
- }
- /**
- * Calculate the exponential of a unit quaternion.
- *
- * @param {quat} out the receiving quaternion
- * @param {ReadonlyQuat} a quat to calculate the exponential of
- * @returns {quat} out
- */
- function exp(out, a) {
- var x = a[0],
- y = a[1],
- z = a[2],
- w = a[3];
- var r = Math.sqrt(x * x + y * y + z * z);
- var et = Math.exp(w);
- var s = r > 0 ? et * Math.sin(r) / r : 0;
- out[0] = x * s;
- out[1] = y * s;
- out[2] = z * s;
- out[3] = et * Math.cos(r);
- return out;
- }
- /**
- * Calculate the natural logarithm of a unit quaternion.
- *
- * @param {quat} out the receiving quaternion
- * @param {ReadonlyQuat} a quat to calculate the exponential of
- * @returns {quat} out
- */
- function ln(out, a) {
- var x = a[0],
- y = a[1],
- z = a[2],
- w = a[3];
- var r = Math.sqrt(x * x + y * y + z * z);
- var t = r > 0 ? Math.atan2(r, w) / r : 0;
- out[0] = x * t;
- out[1] = y * t;
- out[2] = z * t;
- out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);
- return out;
- }
- /**
- * Calculate the scalar power of a unit quaternion.
- *
- * @param {quat} out the receiving quaternion
- * @param {ReadonlyQuat} a quat to calculate the exponential of
- * @param {Number} b amount to scale the quaternion by
- * @returns {quat} out
- */
- function pow(out, a, b) {
- ln(out, a);
- scale(out, out, b);
- exp(out, out);
- return out;
- }
- /**
- * Performs a spherical linear interpolation between two quat
- *
- * @param {quat} out the receiving quaternion
- * @param {ReadonlyQuat} a the first operand
- * @param {ReadonlyQuat} b the second operand
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
- * @returns {quat} out
- */
- function slerp(out, a, b, t) {
- // benchmarks:
- // http://jsperf.com/quaternion-slerp-implementations
- var ax = a[0],
- ay = a[1],
- az = a[2],
- aw = a[3];
- var bx = b[0],
- by = b[1],
- bz = b[2],
- bw = b[3];
- var omega, cosom, sinom, scale0, scale1; // calc cosine
- cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)
- if (cosom < 0.0) {
- cosom = -cosom;
- bx = -bx;
- by = -by;
- bz = -bz;
- bw = -bw;
- } // calculate coefficients
- if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
- // standard case (slerp)
- omega = Math.acos(cosom);
- sinom = Math.sin(omega);
- scale0 = Math.sin((1.0 - t) * omega) / sinom;
- scale1 = Math.sin(t * omega) / sinom;
- } else {
- // "from" and "to" quaternions are very close
- // ... so we can do a linear interpolation
- scale0 = 1.0 - t;
- scale1 = t;
- } // calculate final values
- out[0] = scale0 * ax + scale1 * bx;
- out[1] = scale0 * ay + scale1 * by;
- out[2] = scale0 * az + scale1 * bz;
- out[3] = scale0 * aw + scale1 * bw;
- return out;
- }
- /**
- * Generates a random unit quaternion
- *
- * @param {quat} out the receiving quaternion
- * @returns {quat} out
- */
- function random(out) {
- // Implementation of http://planning.cs.uiuc.edu/node198.html
- // TODO: Calling random 3 times is probably not the fastest solution
- var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]();
- var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]();
- var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]();
- var sqrt1MinusU1 = Math.sqrt(1 - u1);
- var sqrtU1 = Math.sqrt(u1);
- out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);
- out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);
- out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);
- out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);
- return out;
- }
- /**
- * Calculates the inverse of a quat
- *
- * @param {quat} out the receiving quaternion
- * @param {ReadonlyQuat} a quat to calculate inverse of
- * @returns {quat} out
- */
- function invert(out, a) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2],
- a3 = a[3];
- var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;
- var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0
- out[0] = -a0 * invDot;
- out[1] = -a1 * invDot;
- out[2] = -a2 * invDot;
- out[3] = a3 * invDot;
- return out;
- }
- /**
- * Calculates the conjugate of a quat
- * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.
- *
- * @param {quat} out the receiving quaternion
- * @param {ReadonlyQuat} a quat to calculate conjugate of
- * @returns {quat} out
- */
- function conjugate(out, a) {
- out[0] = -a[0];
- out[1] = -a[1];
- out[2] = -a[2];
- out[3] = a[3];
- return out;
- }
- /**
- * Creates a quaternion from the given 3x3 rotation matrix.
- *
- * NOTE: The resultant quaternion is not normalized, so you should be sure
- * to renormalize the quaternion yourself where necessary.
- *
- * @param {quat} out the receiving quaternion
- * @param {ReadonlyMat3} m rotation matrix
- * @returns {quat} out
- * @function
- */
- function fromMat3(out, m) {
- // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes
- // article "Quaternion Calculus and Fast Animation".
- var fTrace = m[0] + m[4] + m[8];
- var fRoot;
- if (fTrace > 0.0) {
- // |w| > 1/2, may as well choose w > 1/2
- fRoot = Math.sqrt(fTrace + 1.0); // 2w
- out[3] = 0.5 * fRoot;
- fRoot = 0.5 / fRoot; // 1/(4w)
- out[0] = (m[5] - m[7]) * fRoot;
- out[1] = (m[6] - m[2]) * fRoot;
- out[2] = (m[1] - m[3]) * fRoot;
- } else {
- // |w| <= 1/2
- var i = 0;
- if (m[4] > m[0]) i = 1;
- if (m[8] > m[i * 3 + i]) i = 2;
- var j = (i + 1) % 3;
- var k = (i + 2) % 3;
- fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);
- out[i] = 0.5 * fRoot;
- fRoot = 0.5 / fRoot;
- out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;
- out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;
- out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;
- }
- return out;
- }
- /**
- * Creates a quaternion from the given euler angle x, y, z.
- *
- * @param {quat} out the receiving quaternion
- * @param {x} Angle to rotate around X axis in degrees.
- * @param {y} Angle to rotate around Y axis in degrees.
- * @param {z} Angle to rotate around Z axis in degrees.
- * @returns {quat} out
- * @function
- */
- function fromEuler(out, x, y, z) {
- var halfToRad = 0.5 * Math.PI / 180.0;
- x *= halfToRad;
- y *= halfToRad;
- z *= halfToRad;
- var sx = Math.sin(x);
- var cx = Math.cos(x);
- var sy = Math.sin(y);
- var cy = Math.cos(y);
- var sz = Math.sin(z);
- var cz = Math.cos(z);
- out[0] = sx * cy * cz - cx * sy * sz;
- out[1] = cx * sy * cz + sx * cy * sz;
- out[2] = cx * cy * sz - sx * sy * cz;
- out[3] = cx * cy * cz + sx * sy * sz;
- return out;
- }
- /**
- * Returns a string representation of a quatenion
- *
- * @param {ReadonlyQuat} a vector to represent as a string
- * @returns {String} string representation of the vector
- */
- function str(a) {
- return "quat(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")";
- }
- /**
- * Creates a new quat initialized with values from an existing quaternion
- *
- * @param {ReadonlyQuat} a quaternion to clone
- * @returns {quat} a new quaternion
- * @function
- */
- var clone = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["clone"];
- /**
- * Creates a new quat initialized with the given values
- *
- * @param {Number} x X component
- * @param {Number} y Y component
- * @param {Number} z Z component
- * @param {Number} w W component
- * @returns {quat} a new quaternion
- * @function
- */
- var fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["fromValues"];
- /**
- * Copy the values from one quat to another
- *
- * @param {quat} out the receiving quaternion
- * @param {ReadonlyQuat} a the source quaternion
- * @returns {quat} out
- * @function
- */
- var copy = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["copy"];
- /**
- * Set the components of a quat to the given values
- *
- * @param {quat} out the receiving quaternion
- * @param {Number} x X component
- * @param {Number} y Y component
- * @param {Number} z Z component
- * @param {Number} w W component
- * @returns {quat} out
- * @function
- */
- var set = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["set"];
- /**
- * Adds two quat's
- *
- * @param {quat} out the receiving quaternion
- * @param {ReadonlyQuat} a the first operand
- * @param {ReadonlyQuat} b the second operand
- * @returns {quat} out
- * @function
- */
- var add = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["add"];
- /**
- * Alias for {@link quat.multiply}
- * @function
- */
- var mul = multiply;
- /**
- * Scales a quat by a scalar number
- *
- * @param {quat} out the receiving vector
- * @param {ReadonlyQuat} a the vector to scale
- * @param {Number} b amount to scale the vector by
- * @returns {quat} out
- * @function
- */
- var scale = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["scale"];
- /**
- * Calculates the dot product of two quat's
- *
- * @param {ReadonlyQuat} a the first operand
- * @param {ReadonlyQuat} b the second operand
- * @returns {Number} dot product of a and b
- * @function
- */
- var dot = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["dot"];
- /**
- * Performs a linear interpolation between two quat's
- *
- * @param {quat} out the receiving quaternion
- * @param {ReadonlyQuat} a the first operand
- * @param {ReadonlyQuat} b the second operand
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
- * @returns {quat} out
- * @function
- */
- var lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["lerp"];
- /**
- * Calculates the length of a quat
- *
- * @param {ReadonlyQuat} a vector to calculate length of
- * @returns {Number} length of a
- */
- var length = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["length"];
- /**
- * Alias for {@link quat.length}
- * @function
- */
- var len = length;
- /**
- * Calculates the squared length of a quat
- *
- * @param {ReadonlyQuat} a vector to calculate squared length of
- * @returns {Number} squared length of a
- * @function
- */
- var squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["squaredLength"];
- /**
- * Alias for {@link quat.squaredLength}
- * @function
- */
- var sqrLen = squaredLength;
- /**
- * Normalize a quat
- *
- * @param {quat} out the receiving quaternion
- * @param {ReadonlyQuat} a quaternion to normalize
- * @returns {quat} out
- * @function
- */
- var normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["normalize"];
- /**
- * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)
- *
- * @param {ReadonlyQuat} a The first quaternion.
- * @param {ReadonlyQuat} b The second quaternion.
- * @returns {Boolean} True if the vectors are equal, false otherwise.
- */
- var exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["exactEquals"];
- /**
- * Returns whether or not the quaternions have approximately the same elements in the same position.
- *
- * @param {ReadonlyQuat} a The first vector.
- * @param {ReadonlyQuat} b The second vector.
- * @returns {Boolean} True if the vectors are equal, false otherwise.
- */
- var equals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["equals"];
- /**
- * Sets a quaternion to represent the shortest rotation from one
- * vector to another.
- *
- * Both vectors are assumed to be unit length.
- *
- * @param {quat} out the receiving quaternion.
- * @param {ReadonlyVec3} a the initial vector
- * @param {ReadonlyVec3} b the destination vector
- * @returns {quat} out
- */
- var rotationTo = function () {
- var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__["create"]();
- var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__["fromValues"](1, 0, 0);
- var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__["fromValues"](0, 1, 0);
- return function (out, a, b) {
- var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__["dot"](a, b);
- if (dot < -0.999999) {
- _vec3_js__WEBPACK_IMPORTED_MODULE_2__["cross"](tmpvec3, xUnitVec3, a);
- if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__["len"](tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__["cross"](tmpvec3, yUnitVec3, a);
- _vec3_js__WEBPACK_IMPORTED_MODULE_2__["normalize"](tmpvec3, tmpvec3);
- setAxisAngle(out, tmpvec3, Math.PI);
- return out;
- } else if (dot > 0.999999) {
- out[0] = 0;
- out[1] = 0;
- out[2] = 0;
- out[3] = 1;
- return out;
- } else {
- _vec3_js__WEBPACK_IMPORTED_MODULE_2__["cross"](tmpvec3, a, b);
- out[0] = tmpvec3[0];
- out[1] = tmpvec3[1];
- out[2] = tmpvec3[2];
- out[3] = 1 + dot;
- return normalize(out, out);
- }
- };
- }();
- /**
- * Performs a spherical linear interpolation with two control points
- *
- * @param {quat} out the receiving quaternion
- * @param {ReadonlyQuat} a the first operand
- * @param {ReadonlyQuat} b the second operand
- * @param {ReadonlyQuat} c the third operand
- * @param {ReadonlyQuat} d the fourth operand
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
- * @returns {quat} out
- */
- var sqlerp = function () {
- var temp1 = create();
- var temp2 = create();
- return function (out, a, b, c, d, t) {
- slerp(temp1, a, d, t);
- slerp(temp2, b, c, t);
- slerp(out, temp1, temp2, 2 * t * (1 - t));
- return out;
- };
- }();
- /**
- * Sets the specified quaternion with values corresponding to the given
- * axes. Each axis is a vec3 and is expected to be unit length and
- * perpendicular to all other specified axes.
- *
- * @param {ReadonlyVec3} view the vector representing the viewing direction
- * @param {ReadonlyVec3} right the vector representing the local "right" direction
- * @param {ReadonlyVec3} up the vector representing the local "up" direction
- * @returns {quat} out
- */
- var setAxes = function () {
- var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_1__["create"]();
- return function (out, view, right, up) {
- matr[0] = right[0];
- matr[3] = right[1];
- matr[6] = right[2];
- matr[1] = up[0];
- matr[4] = up[1];
- matr[7] = up[2];
- matr[2] = -view[0];
- matr[5] = -view[1];
- matr[8] = -view[2];
- return normalize(out, fromMat3(out, matr));
- };
- }();
- /***/ }),
- /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/quat2.js":
- /*!**************************************************************!*\
- !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/quat2.js ***!
- \**************************************************************/
- /*! exports provided: create, clone, fromValues, fromRotationTranslationValues, fromRotationTranslation, fromTranslation, fromRotation, fromMat4, copy, identity, set, getReal, getDual, setReal, setDual, getTranslation, translate, rotateX, rotateY, rotateZ, rotateByQuatAppend, rotateByQuatPrepend, rotateAroundAxis, add, multiply, mul, scale, dot, lerp, invert, conjugate, length, len, squaredLength, sqrLen, normalize, str, exactEquals, equals */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotationTranslationValues", function() { return fromRotationTranslationValues; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotationTranslation", function() { return fromRotationTranslation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromTranslation", function() { return fromTranslation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotation", function() { return fromRotation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromMat4", function() { return fromMat4; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getReal", function() { return getReal; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDual", function() { return getDual; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setReal", function() { return setReal; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDual", function() { return setDual; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTranslation", function() { return getTranslation; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "translate", function() { return translate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateX", function() { return rotateX; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateY", function() { return rotateY; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateZ", function() { return rotateZ; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateByQuatAppend", function() { return rotateByQuatAppend; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateByQuatPrepend", function() { return rotateByQuatPrepend; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateAroundAxis", function() { return rotateAroundAxis; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return dot; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return lerp; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conjugate", function() { return conjugate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "length", function() { return length; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "len", function() { return len; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredLength", function() { return squaredLength; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrLen", function() { return sqrLen; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
- /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
- /* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quat.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/quat.js");
- /* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mat4.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat4.js");
- /**
- * Dual Quaternion<br>
- * Format: [real, dual]<br>
- * Quaternion format: XYZW<br>
- * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.<br>
- * @module quat2
- */
- /**
- * Creates a new identity dual quat
- *
- * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]
- */
- function create() {
- var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](8);
- if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
- dq[0] = 0;
- dq[1] = 0;
- dq[2] = 0;
- dq[4] = 0;
- dq[5] = 0;
- dq[6] = 0;
- dq[7] = 0;
- }
- dq[3] = 1;
- return dq;
- }
- /**
- * Creates a new quat initialized with values from an existing quaternion
- *
- * @param {ReadonlyQuat2} a dual quaternion to clone
- * @returns {quat2} new dual quaternion
- * @function
- */
- function clone(a) {
- var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](8);
- dq[0] = a[0];
- dq[1] = a[1];
- dq[2] = a[2];
- dq[3] = a[3];
- dq[4] = a[4];
- dq[5] = a[5];
- dq[6] = a[6];
- dq[7] = a[7];
- return dq;
- }
- /**
- * Creates a new dual quat initialized with the given values
- *
- * @param {Number} x1 X component
- * @param {Number} y1 Y component
- * @param {Number} z1 Z component
- * @param {Number} w1 W component
- * @param {Number} x2 X component
- * @param {Number} y2 Y component
- * @param {Number} z2 Z component
- * @param {Number} w2 W component
- * @returns {quat2} new dual quaternion
- * @function
- */
- function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {
- var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](8);
- dq[0] = x1;
- dq[1] = y1;
- dq[2] = z1;
- dq[3] = w1;
- dq[4] = x2;
- dq[5] = y2;
- dq[6] = z2;
- dq[7] = w2;
- return dq;
- }
- /**
- * Creates a new dual quat from the given values (quat and translation)
- *
- * @param {Number} x1 X component
- * @param {Number} y1 Y component
- * @param {Number} z1 Z component
- * @param {Number} w1 W component
- * @param {Number} x2 X component (translation)
- * @param {Number} y2 Y component (translation)
- * @param {Number} z2 Z component (translation)
- * @returns {quat2} new dual quaternion
- * @function
- */
- function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {
- var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](8);
- dq[0] = x1;
- dq[1] = y1;
- dq[2] = z1;
- dq[3] = w1;
- var ax = x2 * 0.5,
- ay = y2 * 0.5,
- az = z2 * 0.5;
- dq[4] = ax * w1 + ay * z1 - az * y1;
- dq[5] = ay * w1 + az * x1 - ax * z1;
- dq[6] = az * w1 + ax * y1 - ay * x1;
- dq[7] = -ax * x1 - ay * y1 - az * z1;
- return dq;
- }
- /**
- * Creates a dual quat from a quaternion and a translation
- *
- * @param {ReadonlyQuat2} dual quaternion receiving operation result
- * @param {ReadonlyQuat} q a normalized quaternion
- * @param {ReadonlyVec3} t tranlation vector
- * @returns {quat2} dual quaternion receiving operation result
- * @function
- */
- function fromRotationTranslation(out, q, t) {
- var ax = t[0] * 0.5,
- ay = t[1] * 0.5,
- az = t[2] * 0.5,
- bx = q[0],
- by = q[1],
- bz = q[2],
- bw = q[3];
- out[0] = bx;
- out[1] = by;
- out[2] = bz;
- out[3] = bw;
- out[4] = ax * bw + ay * bz - az * by;
- out[5] = ay * bw + az * bx - ax * bz;
- out[6] = az * bw + ax * by - ay * bx;
- out[7] = -ax * bx - ay * by - az * bz;
- return out;
- }
- /**
- * Creates a dual quat from a translation
- *
- * @param {ReadonlyQuat2} dual quaternion receiving operation result
- * @param {ReadonlyVec3} t translation vector
- * @returns {quat2} dual quaternion receiving operation result
- * @function
- */
- function fromTranslation(out, t) {
- out[0] = 0;
- out[1] = 0;
- out[2] = 0;
- out[3] = 1;
- out[4] = t[0] * 0.5;
- out[5] = t[1] * 0.5;
- out[6] = t[2] * 0.5;
- out[7] = 0;
- return out;
- }
- /**
- * Creates a dual quat from a quaternion
- *
- * @param {ReadonlyQuat2} dual quaternion receiving operation result
- * @param {ReadonlyQuat} q the quaternion
- * @returns {quat2} dual quaternion receiving operation result
- * @function
- */
- function fromRotation(out, q) {
- out[0] = q[0];
- out[1] = q[1];
- out[2] = q[2];
- out[3] = q[3];
- out[4] = 0;
- out[5] = 0;
- out[6] = 0;
- out[7] = 0;
- return out;
- }
- /**
- * Creates a new dual quat from a matrix (4x4)
- *
- * @param {quat2} out the dual quaternion
- * @param {ReadonlyMat4} a the matrix
- * @returns {quat2} dual quat receiving operation result
- * @function
- */
- function fromMat4(out, a) {
- //TODO Optimize this
- var outer = _quat_js__WEBPACK_IMPORTED_MODULE_1__["create"]();
- _mat4_js__WEBPACK_IMPORTED_MODULE_2__["getRotation"](outer, a);
- var t = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
- _mat4_js__WEBPACK_IMPORTED_MODULE_2__["getTranslation"](t, a);
- fromRotationTranslation(out, outer, t);
- return out;
- }
- /**
- * Copy the values from one dual quat to another
- *
- * @param {quat2} out the receiving dual quaternion
- * @param {ReadonlyQuat2} a the source dual quaternion
- * @returns {quat2} out
- * @function
- */
- function copy(out, a) {
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- out[4] = a[4];
- out[5] = a[5];
- out[6] = a[6];
- out[7] = a[7];
- return out;
- }
- /**
- * Set a dual quat to the identity dual quaternion
- *
- * @param {quat2} out the receiving quaternion
- * @returns {quat2} out
- */
- function identity(out) {
- out[0] = 0;
- out[1] = 0;
- out[2] = 0;
- out[3] = 1;
- out[4] = 0;
- out[5] = 0;
- out[6] = 0;
- out[7] = 0;
- return out;
- }
- /**
- * Set the components of a dual quat to the given values
- *
- * @param {quat2} out the receiving quaternion
- * @param {Number} x1 X component
- * @param {Number} y1 Y component
- * @param {Number} z1 Z component
- * @param {Number} w1 W component
- * @param {Number} x2 X component
- * @param {Number} y2 Y component
- * @param {Number} z2 Z component
- * @param {Number} w2 W component
- * @returns {quat2} out
- * @function
- */
- function set(out, x1, y1, z1, w1, x2, y2, z2, w2) {
- out[0] = x1;
- out[1] = y1;
- out[2] = z1;
- out[3] = w1;
- out[4] = x2;
- out[5] = y2;
- out[6] = z2;
- out[7] = w2;
- return out;
- }
- /**
- * Gets the real part of a dual quat
- * @param {quat} out real part
- * @param {ReadonlyQuat2} a Dual Quaternion
- * @return {quat} real part
- */
- var getReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__["copy"];
- /**
- * Gets the dual part of a dual quat
- * @param {quat} out dual part
- * @param {ReadonlyQuat2} a Dual Quaternion
- * @return {quat} dual part
- */
- function getDual(out, a) {
- out[0] = a[4];
- out[1] = a[5];
- out[2] = a[6];
- out[3] = a[7];
- return out;
- }
- /**
- * Set the real component of a dual quat to the given quaternion
- *
- * @param {quat2} out the receiving quaternion
- * @param {ReadonlyQuat} q a quaternion representing the real part
- * @returns {quat2} out
- * @function
- */
- var setReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__["copy"];
- /**
- * Set the dual component of a dual quat to the given quaternion
- *
- * @param {quat2} out the receiving quaternion
- * @param {ReadonlyQuat} q a quaternion representing the dual part
- * @returns {quat2} out
- * @function
- */
- function setDual(out, q) {
- out[4] = q[0];
- out[5] = q[1];
- out[6] = q[2];
- out[7] = q[3];
- return out;
- }
- /**
- * Gets the translation of a normalized dual quat
- * @param {vec3} out translation
- * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed
- * @return {vec3} translation
- */
- function getTranslation(out, a) {
- var ax = a[4],
- ay = a[5],
- az = a[6],
- aw = a[7],
- bx = -a[0],
- by = -a[1],
- bz = -a[2],
- bw = a[3];
- out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;
- out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;
- out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;
- return out;
- }
- /**
- * Translates a dual quat by the given vector
- *
- * @param {quat2} out the receiving dual quaternion
- * @param {ReadonlyQuat2} a the dual quaternion to translate
- * @param {ReadonlyVec3} v vector to translate by
- * @returns {quat2} out
- */
- function translate(out, a, v) {
- var ax1 = a[0],
- ay1 = a[1],
- az1 = a[2],
- aw1 = a[3],
- bx1 = v[0] * 0.5,
- by1 = v[1] * 0.5,
- bz1 = v[2] * 0.5,
- ax2 = a[4],
- ay2 = a[5],
- az2 = a[6],
- aw2 = a[7];
- out[0] = ax1;
- out[1] = ay1;
- out[2] = az1;
- out[3] = aw1;
- out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;
- out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;
- out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;
- out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;
- return out;
- }
- /**
- * Rotates a dual quat around the X axis
- *
- * @param {quat2} out the receiving dual quaternion
- * @param {ReadonlyQuat2} a the dual quaternion to rotate
- * @param {number} rad how far should the rotation be
- * @returns {quat2} out
- */
- function rotateX(out, a, rad) {
- var bx = -a[0],
- by = -a[1],
- bz = -a[2],
- bw = a[3],
- ax = a[4],
- ay = a[5],
- az = a[6],
- aw = a[7],
- ax1 = ax * bw + aw * bx + ay * bz - az * by,
- ay1 = ay * bw + aw * by + az * bx - ax * bz,
- az1 = az * bw + aw * bz + ax * by - ay * bx,
- aw1 = aw * bw - ax * bx - ay * by - az * bz;
- _quat_js__WEBPACK_IMPORTED_MODULE_1__["rotateX"](out, a, rad);
- bx = out[0];
- by = out[1];
- bz = out[2];
- bw = out[3];
- out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;
- out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;
- out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;
- out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;
- return out;
- }
- /**
- * Rotates a dual quat around the Y axis
- *
- * @param {quat2} out the receiving dual quaternion
- * @param {ReadonlyQuat2} a the dual quaternion to rotate
- * @param {number} rad how far should the rotation be
- * @returns {quat2} out
- */
- function rotateY(out, a, rad) {
- var bx = -a[0],
- by = -a[1],
- bz = -a[2],
- bw = a[3],
- ax = a[4],
- ay = a[5],
- az = a[6],
- aw = a[7],
- ax1 = ax * bw + aw * bx + ay * bz - az * by,
- ay1 = ay * bw + aw * by + az * bx - ax * bz,
- az1 = az * bw + aw * bz + ax * by - ay * bx,
- aw1 = aw * bw - ax * bx - ay * by - az * bz;
- _quat_js__WEBPACK_IMPORTED_MODULE_1__["rotateY"](out, a, rad);
- bx = out[0];
- by = out[1];
- bz = out[2];
- bw = out[3];
- out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;
- out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;
- out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;
- out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;
- return out;
- }
- /**
- * Rotates a dual quat around the Z axis
- *
- * @param {quat2} out the receiving dual quaternion
- * @param {ReadonlyQuat2} a the dual quaternion to rotate
- * @param {number} rad how far should the rotation be
- * @returns {quat2} out
- */
- function rotateZ(out, a, rad) {
- var bx = -a[0],
- by = -a[1],
- bz = -a[2],
- bw = a[3],
- ax = a[4],
- ay = a[5],
- az = a[6],
- aw = a[7],
- ax1 = ax * bw + aw * bx + ay * bz - az * by,
- ay1 = ay * bw + aw * by + az * bx - ax * bz,
- az1 = az * bw + aw * bz + ax * by - ay * bx,
- aw1 = aw * bw - ax * bx - ay * by - az * bz;
- _quat_js__WEBPACK_IMPORTED_MODULE_1__["rotateZ"](out, a, rad);
- bx = out[0];
- by = out[1];
- bz = out[2];
- bw = out[3];
- out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;
- out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;
- out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;
- out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;
- return out;
- }
- /**
- * Rotates a dual quat by a given quaternion (a * q)
- *
- * @param {quat2} out the receiving dual quaternion
- * @param {ReadonlyQuat2} a the dual quaternion to rotate
- * @param {ReadonlyQuat} q quaternion to rotate by
- * @returns {quat2} out
- */
- function rotateByQuatAppend(out, a, q) {
- var qx = q[0],
- qy = q[1],
- qz = q[2],
- qw = q[3],
- ax = a[0],
- ay = a[1],
- az = a[2],
- aw = a[3];
- out[0] = ax * qw + aw * qx + ay * qz - az * qy;
- out[1] = ay * qw + aw * qy + az * qx - ax * qz;
- out[2] = az * qw + aw * qz + ax * qy - ay * qx;
- out[3] = aw * qw - ax * qx - ay * qy - az * qz;
- ax = a[4];
- ay = a[5];
- az = a[6];
- aw = a[7];
- out[4] = ax * qw + aw * qx + ay * qz - az * qy;
- out[5] = ay * qw + aw * qy + az * qx - ax * qz;
- out[6] = az * qw + aw * qz + ax * qy - ay * qx;
- out[7] = aw * qw - ax * qx - ay * qy - az * qz;
- return out;
- }
- /**
- * Rotates a dual quat by a given quaternion (q * a)
- *
- * @param {quat2} out the receiving dual quaternion
- * @param {ReadonlyQuat} q quaternion to rotate by
- * @param {ReadonlyQuat2} a the dual quaternion to rotate
- * @returns {quat2} out
- */
- function rotateByQuatPrepend(out, q, a) {
- var qx = q[0],
- qy = q[1],
- qz = q[2],
- qw = q[3],
- bx = a[0],
- by = a[1],
- bz = a[2],
- bw = a[3];
- out[0] = qx * bw + qw * bx + qy * bz - qz * by;
- out[1] = qy * bw + qw * by + qz * bx - qx * bz;
- out[2] = qz * bw + qw * bz + qx * by - qy * bx;
- out[3] = qw * bw - qx * bx - qy * by - qz * bz;
- bx = a[4];
- by = a[5];
- bz = a[6];
- bw = a[7];
- out[4] = qx * bw + qw * bx + qy * bz - qz * by;
- out[5] = qy * bw + qw * by + qz * bx - qx * bz;
- out[6] = qz * bw + qw * bz + qx * by - qy * bx;
- out[7] = qw * bw - qx * bx - qy * by - qz * bz;
- return out;
- }
- /**
- * Rotates a dual quat around a given axis. Does the normalisation automatically
- *
- * @param {quat2} out the receiving dual quaternion
- * @param {ReadonlyQuat2} a the dual quaternion to rotate
- * @param {ReadonlyVec3} axis the axis to rotate around
- * @param {Number} rad how far the rotation should be
- * @returns {quat2} out
- */
- function rotateAroundAxis(out, a, axis, rad) {
- //Special case for rad = 0
- if (Math.abs(rad) < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
- return copy(out, a);
- }
- var axisLength = Math.hypot(axis[0], axis[1], axis[2]);
- rad = rad * 0.5;
- var s = Math.sin(rad);
- var bx = s * axis[0] / axisLength;
- var by = s * axis[1] / axisLength;
- var bz = s * axis[2] / axisLength;
- var bw = Math.cos(rad);
- var ax1 = a[0],
- ay1 = a[1],
- az1 = a[2],
- aw1 = a[3];
- out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;
- out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;
- out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;
- out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;
- var ax = a[4],
- ay = a[5],
- az = a[6],
- aw = a[7];
- out[4] = ax * bw + aw * bx + ay * bz - az * by;
- out[5] = ay * bw + aw * by + az * bx - ax * bz;
- out[6] = az * bw + aw * bz + ax * by - ay * bx;
- out[7] = aw * bw - ax * bx - ay * by - az * bz;
- return out;
- }
- /**
- * Adds two dual quat's
- *
- * @param {quat2} out the receiving dual quaternion
- * @param {ReadonlyQuat2} a the first operand
- * @param {ReadonlyQuat2} b the second operand
- * @returns {quat2} out
- * @function
- */
- function add(out, a, b) {
- out[0] = a[0] + b[0];
- out[1] = a[1] + b[1];
- out[2] = a[2] + b[2];
- out[3] = a[3] + b[3];
- out[4] = a[4] + b[4];
- out[5] = a[5] + b[5];
- out[6] = a[6] + b[6];
- out[7] = a[7] + b[7];
- return out;
- }
- /**
- * Multiplies two dual quat's
- *
- * @param {quat2} out the receiving dual quaternion
- * @param {ReadonlyQuat2} a the first operand
- * @param {ReadonlyQuat2} b the second operand
- * @returns {quat2} out
- */
- function multiply(out, a, b) {
- var ax0 = a[0],
- ay0 = a[1],
- az0 = a[2],
- aw0 = a[3],
- bx1 = b[4],
- by1 = b[5],
- bz1 = b[6],
- bw1 = b[7],
- ax1 = a[4],
- ay1 = a[5],
- az1 = a[6],
- aw1 = a[7],
- bx0 = b[0],
- by0 = b[1],
- bz0 = b[2],
- bw0 = b[3];
- out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;
- out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;
- out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;
- out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;
- out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;
- out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;
- out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;
- out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;
- return out;
- }
- /**
- * Alias for {@link quat2.multiply}
- * @function
- */
- var mul = multiply;
- /**
- * Scales a dual quat by a scalar number
- *
- * @param {quat2} out the receiving dual quat
- * @param {ReadonlyQuat2} a the dual quat to scale
- * @param {Number} b amount to scale the dual quat by
- * @returns {quat2} out
- * @function
- */
- function scale(out, a, b) {
- out[0] = a[0] * b;
- out[1] = a[1] * b;
- out[2] = a[2] * b;
- out[3] = a[3] * b;
- out[4] = a[4] * b;
- out[5] = a[5] * b;
- out[6] = a[6] * b;
- out[7] = a[7] * b;
- return out;
- }
- /**
- * Calculates the dot product of two dual quat's (The dot product of the real parts)
- *
- * @param {ReadonlyQuat2} a the first operand
- * @param {ReadonlyQuat2} b the second operand
- * @returns {Number} dot product of a and b
- * @function
- */
- var dot = _quat_js__WEBPACK_IMPORTED_MODULE_1__["dot"];
- /**
- * Performs a linear interpolation between two dual quats's
- * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)
- *
- * @param {quat2} out the receiving dual quat
- * @param {ReadonlyQuat2} a the first operand
- * @param {ReadonlyQuat2} b the second operand
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
- * @returns {quat2} out
- */
- function lerp(out, a, b, t) {
- var mt = 1 - t;
- if (dot(a, b) < 0) t = -t;
- out[0] = a[0] * mt + b[0] * t;
- out[1] = a[1] * mt + b[1] * t;
- out[2] = a[2] * mt + b[2] * t;
- out[3] = a[3] * mt + b[3] * t;
- out[4] = a[4] * mt + b[4] * t;
- out[5] = a[5] * mt + b[5] * t;
- out[6] = a[6] * mt + b[6] * t;
- out[7] = a[7] * mt + b[7] * t;
- return out;
- }
- /**
- * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper
- *
- * @param {quat2} out the receiving dual quaternion
- * @param {ReadonlyQuat2} a dual quat to calculate inverse of
- * @returns {quat2} out
- */
- function invert(out, a) {
- var sqlen = squaredLength(a);
- out[0] = -a[0] / sqlen;
- out[1] = -a[1] / sqlen;
- out[2] = -a[2] / sqlen;
- out[3] = a[3] / sqlen;
- out[4] = -a[4] / sqlen;
- out[5] = -a[5] / sqlen;
- out[6] = -a[6] / sqlen;
- out[7] = a[7] / sqlen;
- return out;
- }
- /**
- * Calculates the conjugate of a dual quat
- * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.
- *
- * @param {quat2} out the receiving quaternion
- * @param {ReadonlyQuat2} a quat to calculate conjugate of
- * @returns {quat2} out
- */
- function conjugate(out, a) {
- out[0] = -a[0];
- out[1] = -a[1];
- out[2] = -a[2];
- out[3] = a[3];
- out[4] = -a[4];
- out[5] = -a[5];
- out[6] = -a[6];
- out[7] = a[7];
- return out;
- }
- /**
- * Calculates the length of a dual quat
- *
- * @param {ReadonlyQuat2} a dual quat to calculate length of
- * @returns {Number} length of a
- * @function
- */
- var length = _quat_js__WEBPACK_IMPORTED_MODULE_1__["length"];
- /**
- * Alias for {@link quat2.length}
- * @function
- */
- var len = length;
- /**
- * Calculates the squared length of a dual quat
- *
- * @param {ReadonlyQuat2} a dual quat to calculate squared length of
- * @returns {Number} squared length of a
- * @function
- */
- var squaredLength = _quat_js__WEBPACK_IMPORTED_MODULE_1__["squaredLength"];
- /**
- * Alias for {@link quat2.squaredLength}
- * @function
- */
- var sqrLen = squaredLength;
- /**
- * Normalize a dual quat
- *
- * @param {quat2} out the receiving dual quaternion
- * @param {ReadonlyQuat2} a dual quaternion to normalize
- * @returns {quat2} out
- * @function
- */
- function normalize(out, a) {
- var magnitude = squaredLength(a);
- if (magnitude > 0) {
- magnitude = Math.sqrt(magnitude);
- var a0 = a[0] / magnitude;
- var a1 = a[1] / magnitude;
- var a2 = a[2] / magnitude;
- var a3 = a[3] / magnitude;
- var b0 = a[4];
- var b1 = a[5];
- var b2 = a[6];
- var b3 = a[7];
- var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;
- out[0] = a0;
- out[1] = a1;
- out[2] = a2;
- out[3] = a3;
- out[4] = (b0 - a0 * a_dot_b) / magnitude;
- out[5] = (b1 - a1 * a_dot_b) / magnitude;
- out[6] = (b2 - a2 * a_dot_b) / magnitude;
- out[7] = (b3 - a3 * a_dot_b) / magnitude;
- }
- return out;
- }
- /**
- * Returns a string representation of a dual quatenion
- *
- * @param {ReadonlyQuat2} a dual quaternion to represent as a string
- * @returns {String} string representation of the dual quat
- */
- function str(a) {
- return "quat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ")";
- }
- /**
- * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)
- *
- * @param {ReadonlyQuat2} a the first dual quaternion.
- * @param {ReadonlyQuat2} b the second dual quaternion.
- * @returns {Boolean} true if the dual quaternions are equal, false otherwise.
- */
- function exactEquals(a, b) {
- return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];
- }
- /**
- * Returns whether or not the dual quaternions have approximately the same elements in the same position.
- *
- * @param {ReadonlyQuat2} a the first dual quat.
- * @param {ReadonlyQuat2} b the second dual quat.
- * @returns {Boolean} true if the dual quats are equal, false otherwise.
- */
- function equals(a, b) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2],
- a3 = a[3],
- a4 = a[4],
- a5 = a[5],
- a6 = a[6],
- a7 = a[7];
- var b0 = b[0],
- b1 = b[1],
- b2 = b[2],
- b3 = b[3],
- b4 = b[4],
- b5 = b[5],
- b6 = b[6],
- b7 = b[7];
- return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a7), Math.abs(b7));
- }
- /***/ }),
- /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec2.js":
- /*!*************************************************************!*\
- !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec2.js ***!
- \*************************************************************/
- /*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat2, transformMat2d, transformMat3, transformMat4, rotate, angle, zero, str, exactEquals, equals, len, sub, mul, div, dist, sqrDist, sqrLen, forEach */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return divide; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return ceil; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return floor; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "round", function() { return round; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scaleAndAdd", function() { return scaleAndAdd; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distance", function() { return distance; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredDistance", function() { return squaredDistance; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "length", function() { return length; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredLength", function() { return squaredLength; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return negate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inverse", function() { return inverse; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return dot; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cross", function() { return cross; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return lerp; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return random; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat2", function() { return transformMat2; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat2d", function() { return transformMat2d; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat3", function() { return transformMat3; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat4", function() { return transformMat4; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotate", function() { return rotate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "angle", function() { return angle; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zero", function() { return zero; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "len", function() { return len; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "div", function() { return div; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dist", function() { return dist; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrDist", function() { return sqrDist; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrLen", function() { return sqrLen; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; });
- /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
- /**
- * 2 Dimensional Vector
- * @module vec2
- */
- /**
- * Creates a new, empty vec2
- *
- * @returns {vec2} a new 2D vector
- */
- function create() {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](2);
- if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
- out[0] = 0;
- out[1] = 0;
- }
- return out;
- }
- /**
- * Creates a new vec2 initialized with values from an existing vector
- *
- * @param {ReadonlyVec2} a vector to clone
- * @returns {vec2} a new 2D vector
- */
- function clone(a) {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](2);
- out[0] = a[0];
- out[1] = a[1];
- return out;
- }
- /**
- * Creates a new vec2 initialized with the given values
- *
- * @param {Number} x X component
- * @param {Number} y Y component
- * @returns {vec2} a new 2D vector
- */
- function fromValues(x, y) {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](2);
- out[0] = x;
- out[1] = y;
- return out;
- }
- /**
- * Copy the values from one vec2 to another
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a the source vector
- * @returns {vec2} out
- */
- function copy(out, a) {
- out[0] = a[0];
- out[1] = a[1];
- return out;
- }
- /**
- * Set the components of a vec2 to the given values
- *
- * @param {vec2} out the receiving vector
- * @param {Number} x X component
- * @param {Number} y Y component
- * @returns {vec2} out
- */
- function set(out, x, y) {
- out[0] = x;
- out[1] = y;
- return out;
- }
- /**
- * Adds two vec2's
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a the first operand
- * @param {ReadonlyVec2} b the second operand
- * @returns {vec2} out
- */
- function add(out, a, b) {
- out[0] = a[0] + b[0];
- out[1] = a[1] + b[1];
- return out;
- }
- /**
- * Subtracts vector b from vector a
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a the first operand
- * @param {ReadonlyVec2} b the second operand
- * @returns {vec2} out
- */
- function subtract(out, a, b) {
- out[0] = a[0] - b[0];
- out[1] = a[1] - b[1];
- return out;
- }
- /**
- * Multiplies two vec2's
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a the first operand
- * @param {ReadonlyVec2} b the second operand
- * @returns {vec2} out
- */
- function multiply(out, a, b) {
- out[0] = a[0] * b[0];
- out[1] = a[1] * b[1];
- return out;
- }
- /**
- * Divides two vec2's
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a the first operand
- * @param {ReadonlyVec2} b the second operand
- * @returns {vec2} out
- */
- function divide(out, a, b) {
- out[0] = a[0] / b[0];
- out[1] = a[1] / b[1];
- return out;
- }
- /**
- * Math.ceil the components of a vec2
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a vector to ceil
- * @returns {vec2} out
- */
- function ceil(out, a) {
- out[0] = Math.ceil(a[0]);
- out[1] = Math.ceil(a[1]);
- return out;
- }
- /**
- * Math.floor the components of a vec2
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a vector to floor
- * @returns {vec2} out
- */
- function floor(out, a) {
- out[0] = Math.floor(a[0]);
- out[1] = Math.floor(a[1]);
- return out;
- }
- /**
- * Returns the minimum of two vec2's
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a the first operand
- * @param {ReadonlyVec2} b the second operand
- * @returns {vec2} out
- */
- function min(out, a, b) {
- out[0] = Math.min(a[0], b[0]);
- out[1] = Math.min(a[1], b[1]);
- return out;
- }
- /**
- * Returns the maximum of two vec2's
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a the first operand
- * @param {ReadonlyVec2} b the second operand
- * @returns {vec2} out
- */
- function max(out, a, b) {
- out[0] = Math.max(a[0], b[0]);
- out[1] = Math.max(a[1], b[1]);
- return out;
- }
- /**
- * Math.round the components of a vec2
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a vector to round
- * @returns {vec2} out
- */
- function round(out, a) {
- out[0] = Math.round(a[0]);
- out[1] = Math.round(a[1]);
- return out;
- }
- /**
- * Scales a vec2 by a scalar number
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a the vector to scale
- * @param {Number} b amount to scale the vector by
- * @returns {vec2} out
- */
- function scale(out, a, b) {
- out[0] = a[0] * b;
- out[1] = a[1] * b;
- return out;
- }
- /**
- * Adds two vec2's after scaling the second operand by a scalar value
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a the first operand
- * @param {ReadonlyVec2} b the second operand
- * @param {Number} scale the amount to scale b by before adding
- * @returns {vec2} out
- */
- function scaleAndAdd(out, a, b, scale) {
- out[0] = a[0] + b[0] * scale;
- out[1] = a[1] + b[1] * scale;
- return out;
- }
- /**
- * Calculates the euclidian distance between two vec2's
- *
- * @param {ReadonlyVec2} a the first operand
- * @param {ReadonlyVec2} b the second operand
- * @returns {Number} distance between a and b
- */
- function distance(a, b) {
- var x = b[0] - a[0],
- y = b[1] - a[1];
- return Math.hypot(x, y);
- }
- /**
- * Calculates the squared euclidian distance between two vec2's
- *
- * @param {ReadonlyVec2} a the first operand
- * @param {ReadonlyVec2} b the second operand
- * @returns {Number} squared distance between a and b
- */
- function squaredDistance(a, b) {
- var x = b[0] - a[0],
- y = b[1] - a[1];
- return x * x + y * y;
- }
- /**
- * Calculates the length of a vec2
- *
- * @param {ReadonlyVec2} a vector to calculate length of
- * @returns {Number} length of a
- */
- function length(a) {
- var x = a[0],
- y = a[1];
- return Math.hypot(x, y);
- }
- /**
- * Calculates the squared length of a vec2
- *
- * @param {ReadonlyVec2} a vector to calculate squared length of
- * @returns {Number} squared length of a
- */
- function squaredLength(a) {
- var x = a[0],
- y = a[1];
- return x * x + y * y;
- }
- /**
- * Negates the components of a vec2
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a vector to negate
- * @returns {vec2} out
- */
- function negate(out, a) {
- out[0] = -a[0];
- out[1] = -a[1];
- return out;
- }
- /**
- * Returns the inverse of the components of a vec2
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a vector to invert
- * @returns {vec2} out
- */
- function inverse(out, a) {
- out[0] = 1.0 / a[0];
- out[1] = 1.0 / a[1];
- return out;
- }
- /**
- * Normalize a vec2
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a vector to normalize
- * @returns {vec2} out
- */
- function normalize(out, a) {
- var x = a[0],
- y = a[1];
- var len = x * x + y * y;
- if (len > 0) {
- //TODO: evaluate use of glm_invsqrt here?
- len = 1 / Math.sqrt(len);
- }
- out[0] = a[0] * len;
- out[1] = a[1] * len;
- return out;
- }
- /**
- * Calculates the dot product of two vec2's
- *
- * @param {ReadonlyVec2} a the first operand
- * @param {ReadonlyVec2} b the second operand
- * @returns {Number} dot product of a and b
- */
- function dot(a, b) {
- return a[0] * b[0] + a[1] * b[1];
- }
- /**
- * Computes the cross product of two vec2's
- * Note that the cross product must by definition produce a 3D vector
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec2} a the first operand
- * @param {ReadonlyVec2} b the second operand
- * @returns {vec3} out
- */
- function cross(out, a, b) {
- var z = a[0] * b[1] - a[1] * b[0];
- out[0] = out[1] = 0;
- out[2] = z;
- return out;
- }
- /**
- * Performs a linear interpolation between two vec2's
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a the first operand
- * @param {ReadonlyVec2} b the second operand
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
- * @returns {vec2} out
- */
- function lerp(out, a, b, t) {
- var ax = a[0],
- ay = a[1];
- out[0] = ax + t * (b[0] - ax);
- out[1] = ay + t * (b[1] - ay);
- return out;
- }
- /**
- * Generates a random vector with the given scale
- *
- * @param {vec2} out the receiving vector
- * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned
- * @returns {vec2} out
- */
- function random(out, scale) {
- scale = scale || 1.0;
- var r = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2.0 * Math.PI;
- out[0] = Math.cos(r) * scale;
- out[1] = Math.sin(r) * scale;
- return out;
- }
- /**
- * Transforms the vec2 with a mat2
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a the vector to transform
- * @param {ReadonlyMat2} m matrix to transform with
- * @returns {vec2} out
- */
- function transformMat2(out, a, m) {
- var x = a[0],
- y = a[1];
- out[0] = m[0] * x + m[2] * y;
- out[1] = m[1] * x + m[3] * y;
- return out;
- }
- /**
- * Transforms the vec2 with a mat2d
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a the vector to transform
- * @param {ReadonlyMat2d} m matrix to transform with
- * @returns {vec2} out
- */
- function transformMat2d(out, a, m) {
- var x = a[0],
- y = a[1];
- out[0] = m[0] * x + m[2] * y + m[4];
- out[1] = m[1] * x + m[3] * y + m[5];
- return out;
- }
- /**
- * Transforms the vec2 with a mat3
- * 3rd vector component is implicitly '1'
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a the vector to transform
- * @param {ReadonlyMat3} m matrix to transform with
- * @returns {vec2} out
- */
- function transformMat3(out, a, m) {
- var x = a[0],
- y = a[1];
- out[0] = m[0] * x + m[3] * y + m[6];
- out[1] = m[1] * x + m[4] * y + m[7];
- return out;
- }
- /**
- * Transforms the vec2 with a mat4
- * 3rd vector component is implicitly '0'
- * 4th vector component is implicitly '1'
- *
- * @param {vec2} out the receiving vector
- * @param {ReadonlyVec2} a the vector to transform
- * @param {ReadonlyMat4} m matrix to transform with
- * @returns {vec2} out
- */
- function transformMat4(out, a, m) {
- var x = a[0];
- var y = a[1];
- out[0] = m[0] * x + m[4] * y + m[12];
- out[1] = m[1] * x + m[5] * y + m[13];
- return out;
- }
- /**
- * Rotate a 2D vector
- * @param {vec2} out The receiving vec2
- * @param {ReadonlyVec2} a The vec2 point to rotate
- * @param {ReadonlyVec2} b The origin of the rotation
- * @param {Number} rad The angle of rotation in radians
- * @returns {vec2} out
- */
- function rotate(out, a, b, rad) {
- //Translate point to the origin
- var p0 = a[0] - b[0],
- p1 = a[1] - b[1],
- sinC = Math.sin(rad),
- cosC = Math.cos(rad); //perform rotation and translate to correct position
- out[0] = p0 * cosC - p1 * sinC + b[0];
- out[1] = p0 * sinC + p1 * cosC + b[1];
- return out;
- }
- /**
- * Get the angle between two 2D vectors
- * @param {ReadonlyVec2} a The first operand
- * @param {ReadonlyVec2} b The second operand
- * @returns {Number} The angle in radians
- */
- function angle(a, b) {
- var x1 = a[0],
- y1 = a[1],
- x2 = b[0],
- y2 = b[1],
- // mag is the product of the magnitudes of a and b
- mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),
- // mag &&.. short circuits if mag == 0
- cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1
- return Math.acos(Math.min(Math.max(cosine, -1), 1));
- }
- /**
- * Set the components of a vec2 to zero
- *
- * @param {vec2} out the receiving vector
- * @returns {vec2} out
- */
- function zero(out) {
- out[0] = 0.0;
- out[1] = 0.0;
- return out;
- }
- /**
- * Returns a string representation of a vector
- *
- * @param {ReadonlyVec2} a vector to represent as a string
- * @returns {String} string representation of the vector
- */
- function str(a) {
- return "vec2(" + a[0] + ", " + a[1] + ")";
- }
- /**
- * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)
- *
- * @param {ReadonlyVec2} a The first vector.
- * @param {ReadonlyVec2} b The second vector.
- * @returns {Boolean} True if the vectors are equal, false otherwise.
- */
- function exactEquals(a, b) {
- return a[0] === b[0] && a[1] === b[1];
- }
- /**
- * Returns whether or not the vectors have approximately the same elements in the same position.
- *
- * @param {ReadonlyVec2} a The first vector.
- * @param {ReadonlyVec2} b The second vector.
- * @returns {Boolean} True if the vectors are equal, false otherwise.
- */
- function equals(a, b) {
- var a0 = a[0],
- a1 = a[1];
- var b0 = b[0],
- b1 = b[1];
- return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1));
- }
- /**
- * Alias for {@link vec2.length}
- * @function
- */
- var len = length;
- /**
- * Alias for {@link vec2.subtract}
- * @function
- */
- var sub = subtract;
- /**
- * Alias for {@link vec2.multiply}
- * @function
- */
- var mul = multiply;
- /**
- * Alias for {@link vec2.divide}
- * @function
- */
- var div = divide;
- /**
- * Alias for {@link vec2.distance}
- * @function
- */
- var dist = distance;
- /**
- * Alias for {@link vec2.squaredDistance}
- * @function
- */
- var sqrDist = squaredDistance;
- /**
- * Alias for {@link vec2.squaredLength}
- * @function
- */
- var sqrLen = squaredLength;
- /**
- * Perform some operation over an array of vec2s.
- *
- * @param {Array} a the array of vectors to iterate over
- * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed
- * @param {Number} offset Number of elements to skip at the beginning of the array
- * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array
- * @param {Function} fn Function to call for each vector in the array
- * @param {Object} [arg] additional argument to pass to fn
- * @returns {Array} a
- * @function
- */
- var forEach = function () {
- var vec = create();
- return function (a, stride, offset, count, fn, arg) {
- var i, l;
- if (!stride) {
- stride = 2;
- }
- if (!offset) {
- offset = 0;
- }
- if (count) {
- l = Math.min(count * stride + offset, a.length);
- } else {
- l = a.length;
- }
- for (i = offset; i < l; i += stride) {
- vec[0] = a[i];
- vec[1] = a[i + 1];
- fn(vec, vec, arg);
- a[i] = vec[0];
- a[i + 1] = vec[1];
- }
- return a;
- };
- }();
- /***/ }),
- /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec3.js":
- /*!*************************************************************!*\
- !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec3.js ***!
- \*************************************************************/
- /*! exports provided: create, clone, length, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, squaredLength, negate, inverse, normalize, dot, cross, lerp, hermite, bezier, random, transformMat4, transformMat3, transformQuat, rotateX, rotateY, rotateZ, angle, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "length", function() { return length; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return divide; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return ceil; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return floor; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "round", function() { return round; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scaleAndAdd", function() { return scaleAndAdd; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distance", function() { return distance; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredDistance", function() { return squaredDistance; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredLength", function() { return squaredLength; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return negate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inverse", function() { return inverse; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return dot; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cross", function() { return cross; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return lerp; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hermite", function() { return hermite; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bezier", function() { return bezier; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return random; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat4", function() { return transformMat4; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat3", function() { return transformMat3; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformQuat", function() { return transformQuat; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateX", function() { return rotateX; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateY", function() { return rotateY; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateZ", function() { return rotateZ; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "angle", function() { return angle; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zero", function() { return zero; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "div", function() { return div; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dist", function() { return dist; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrDist", function() { return sqrDist; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "len", function() { return len; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrLen", function() { return sqrLen; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; });
- /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
- /**
- * 3 Dimensional Vector
- * @module vec3
- */
- /**
- * Creates a new, empty vec3
- *
- * @returns {vec3} a new 3D vector
- */
- function create() {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
- if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
- out[0] = 0;
- out[1] = 0;
- out[2] = 0;
- }
- return out;
- }
- /**
- * Creates a new vec3 initialized with values from an existing vector
- *
- * @param {ReadonlyVec3} a vector to clone
- * @returns {vec3} a new 3D vector
- */
- function clone(a) {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- return out;
- }
- /**
- * Calculates the length of a vec3
- *
- * @param {ReadonlyVec3} a vector to calculate length of
- * @returns {Number} length of a
- */
- function length(a) {
- var x = a[0];
- var y = a[1];
- var z = a[2];
- return Math.hypot(x, y, z);
- }
- /**
- * Creates a new vec3 initialized with the given values
- *
- * @param {Number} x X component
- * @param {Number} y Y component
- * @param {Number} z Z component
- * @returns {vec3} a new 3D vector
- */
- function fromValues(x, y, z) {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
- out[0] = x;
- out[1] = y;
- out[2] = z;
- return out;
- }
- /**
- * Copy the values from one vec3 to another
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the source vector
- * @returns {vec3} out
- */
- function copy(out, a) {
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- return out;
- }
- /**
- * Set the components of a vec3 to the given values
- *
- * @param {vec3} out the receiving vector
- * @param {Number} x X component
- * @param {Number} y Y component
- * @param {Number} z Z component
- * @returns {vec3} out
- */
- function set(out, x, y, z) {
- out[0] = x;
- out[1] = y;
- out[2] = z;
- return out;
- }
- /**
- * Adds two vec3's
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the first operand
- * @param {ReadonlyVec3} b the second operand
- * @returns {vec3} out
- */
- function add(out, a, b) {
- out[0] = a[0] + b[0];
- out[1] = a[1] + b[1];
- out[2] = a[2] + b[2];
- return out;
- }
- /**
- * Subtracts vector b from vector a
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the first operand
- * @param {ReadonlyVec3} b the second operand
- * @returns {vec3} out
- */
- function subtract(out, a, b) {
- out[0] = a[0] - b[0];
- out[1] = a[1] - b[1];
- out[2] = a[2] - b[2];
- return out;
- }
- /**
- * Multiplies two vec3's
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the first operand
- * @param {ReadonlyVec3} b the second operand
- * @returns {vec3} out
- */
- function multiply(out, a, b) {
- out[0] = a[0] * b[0];
- out[1] = a[1] * b[1];
- out[2] = a[2] * b[2];
- return out;
- }
- /**
- * Divides two vec3's
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the first operand
- * @param {ReadonlyVec3} b the second operand
- * @returns {vec3} out
- */
- function divide(out, a, b) {
- out[0] = a[0] / b[0];
- out[1] = a[1] / b[1];
- out[2] = a[2] / b[2];
- return out;
- }
- /**
- * Math.ceil the components of a vec3
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a vector to ceil
- * @returns {vec3} out
- */
- function ceil(out, a) {
- out[0] = Math.ceil(a[0]);
- out[1] = Math.ceil(a[1]);
- out[2] = Math.ceil(a[2]);
- return out;
- }
- /**
- * Math.floor the components of a vec3
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a vector to floor
- * @returns {vec3} out
- */
- function floor(out, a) {
- out[0] = Math.floor(a[0]);
- out[1] = Math.floor(a[1]);
- out[2] = Math.floor(a[2]);
- return out;
- }
- /**
- * Returns the minimum of two vec3's
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the first operand
- * @param {ReadonlyVec3} b the second operand
- * @returns {vec3} out
- */
- function min(out, a, b) {
- out[0] = Math.min(a[0], b[0]);
- out[1] = Math.min(a[1], b[1]);
- out[2] = Math.min(a[2], b[2]);
- return out;
- }
- /**
- * Returns the maximum of two vec3's
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the first operand
- * @param {ReadonlyVec3} b the second operand
- * @returns {vec3} out
- */
- function max(out, a, b) {
- out[0] = Math.max(a[0], b[0]);
- out[1] = Math.max(a[1], b[1]);
- out[2] = Math.max(a[2], b[2]);
- return out;
- }
- /**
- * Math.round the components of a vec3
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a vector to round
- * @returns {vec3} out
- */
- function round(out, a) {
- out[0] = Math.round(a[0]);
- out[1] = Math.round(a[1]);
- out[2] = Math.round(a[2]);
- return out;
- }
- /**
- * Scales a vec3 by a scalar number
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the vector to scale
- * @param {Number} b amount to scale the vector by
- * @returns {vec3} out
- */
- function scale(out, a, b) {
- out[0] = a[0] * b;
- out[1] = a[1] * b;
- out[2] = a[2] * b;
- return out;
- }
- /**
- * Adds two vec3's after scaling the second operand by a scalar value
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the first operand
- * @param {ReadonlyVec3} b the second operand
- * @param {Number} scale the amount to scale b by before adding
- * @returns {vec3} out
- */
- function scaleAndAdd(out, a, b, scale) {
- out[0] = a[0] + b[0] * scale;
- out[1] = a[1] + b[1] * scale;
- out[2] = a[2] + b[2] * scale;
- return out;
- }
- /**
- * Calculates the euclidian distance between two vec3's
- *
- * @param {ReadonlyVec3} a the first operand
- * @param {ReadonlyVec3} b the second operand
- * @returns {Number} distance between a and b
- */
- function distance(a, b) {
- var x = b[0] - a[0];
- var y = b[1] - a[1];
- var z = b[2] - a[2];
- return Math.hypot(x, y, z);
- }
- /**
- * Calculates the squared euclidian distance between two vec3's
- *
- * @param {ReadonlyVec3} a the first operand
- * @param {ReadonlyVec3} b the second operand
- * @returns {Number} squared distance between a and b
- */
- function squaredDistance(a, b) {
- var x = b[0] - a[0];
- var y = b[1] - a[1];
- var z = b[2] - a[2];
- return x * x + y * y + z * z;
- }
- /**
- * Calculates the squared length of a vec3
- *
- * @param {ReadonlyVec3} a vector to calculate squared length of
- * @returns {Number} squared length of a
- */
- function squaredLength(a) {
- var x = a[0];
- var y = a[1];
- var z = a[2];
- return x * x + y * y + z * z;
- }
- /**
- * Negates the components of a vec3
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a vector to negate
- * @returns {vec3} out
- */
- function negate(out, a) {
- out[0] = -a[0];
- out[1] = -a[1];
- out[2] = -a[2];
- return out;
- }
- /**
- * Returns the inverse of the components of a vec3
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a vector to invert
- * @returns {vec3} out
- */
- function inverse(out, a) {
- out[0] = 1.0 / a[0];
- out[1] = 1.0 / a[1];
- out[2] = 1.0 / a[2];
- return out;
- }
- /**
- * Normalize a vec3
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a vector to normalize
- * @returns {vec3} out
- */
- function normalize(out, a) {
- var x = a[0];
- var y = a[1];
- var z = a[2];
- var len = x * x + y * y + z * z;
- if (len > 0) {
- //TODO: evaluate use of glm_invsqrt here?
- len = 1 / Math.sqrt(len);
- }
- out[0] = a[0] * len;
- out[1] = a[1] * len;
- out[2] = a[2] * len;
- return out;
- }
- /**
- * Calculates the dot product of two vec3's
- *
- * @param {ReadonlyVec3} a the first operand
- * @param {ReadonlyVec3} b the second operand
- * @returns {Number} dot product of a and b
- */
- function dot(a, b) {
- return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
- }
- /**
- * Computes the cross product of two vec3's
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the first operand
- * @param {ReadonlyVec3} b the second operand
- * @returns {vec3} out
- */
- function cross(out, a, b) {
- var ax = a[0],
- ay = a[1],
- az = a[2];
- var bx = b[0],
- by = b[1],
- bz = b[2];
- out[0] = ay * bz - az * by;
- out[1] = az * bx - ax * bz;
- out[2] = ax * by - ay * bx;
- return out;
- }
- /**
- * Performs a linear interpolation between two vec3's
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the first operand
- * @param {ReadonlyVec3} b the second operand
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
- * @returns {vec3} out
- */
- function lerp(out, a, b, t) {
- var ax = a[0];
- var ay = a[1];
- var az = a[2];
- out[0] = ax + t * (b[0] - ax);
- out[1] = ay + t * (b[1] - ay);
- out[2] = az + t * (b[2] - az);
- return out;
- }
- /**
- * Performs a hermite interpolation with two control points
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the first operand
- * @param {ReadonlyVec3} b the second operand
- * @param {ReadonlyVec3} c the third operand
- * @param {ReadonlyVec3} d the fourth operand
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
- * @returns {vec3} out
- */
- function hermite(out, a, b, c, d, t) {
- var factorTimes2 = t * t;
- var factor1 = factorTimes2 * (2 * t - 3) + 1;
- var factor2 = factorTimes2 * (t - 2) + t;
- var factor3 = factorTimes2 * (t - 1);
- var factor4 = factorTimes2 * (3 - 2 * t);
- out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;
- out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;
- out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;
- return out;
- }
- /**
- * Performs a bezier interpolation with two control points
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the first operand
- * @param {ReadonlyVec3} b the second operand
- * @param {ReadonlyVec3} c the third operand
- * @param {ReadonlyVec3} d the fourth operand
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
- * @returns {vec3} out
- */
- function bezier(out, a, b, c, d, t) {
- var inverseFactor = 1 - t;
- var inverseFactorTimesTwo = inverseFactor * inverseFactor;
- var factorTimes2 = t * t;
- var factor1 = inverseFactorTimesTwo * inverseFactor;
- var factor2 = 3 * t * inverseFactorTimesTwo;
- var factor3 = 3 * factorTimes2 * inverseFactor;
- var factor4 = factorTimes2 * t;
- out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;
- out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;
- out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;
- return out;
- }
- /**
- * Generates a random vector with the given scale
- *
- * @param {vec3} out the receiving vector
- * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned
- * @returns {vec3} out
- */
- function random(out, scale) {
- scale = scale || 1.0;
- var r = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2.0 * Math.PI;
- var z = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2.0 - 1.0;
- var zScale = Math.sqrt(1.0 - z * z) * scale;
- out[0] = Math.cos(r) * zScale;
- out[1] = Math.sin(r) * zScale;
- out[2] = z * scale;
- return out;
- }
- /**
- * Transforms the vec3 with a mat4.
- * 4th vector component is implicitly '1'
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the vector to transform
- * @param {ReadonlyMat4} m matrix to transform with
- * @returns {vec3} out
- */
- function transformMat4(out, a, m) {
- var x = a[0],
- y = a[1],
- z = a[2];
- var w = m[3] * x + m[7] * y + m[11] * z + m[15];
- w = w || 1.0;
- out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;
- out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;
- out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;
- return out;
- }
- /**
- * Transforms the vec3 with a mat3.
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the vector to transform
- * @param {ReadonlyMat3} m the 3x3 matrix to transform with
- * @returns {vec3} out
- */
- function transformMat3(out, a, m) {
- var x = a[0],
- y = a[1],
- z = a[2];
- out[0] = x * m[0] + y * m[3] + z * m[6];
- out[1] = x * m[1] + y * m[4] + z * m[7];
- out[2] = x * m[2] + y * m[5] + z * m[8];
- return out;
- }
- /**
- * Transforms the vec3 with a quat
- * Can also be used for dual quaternions. (Multiply it with the real part)
- *
- * @param {vec3} out the receiving vector
- * @param {ReadonlyVec3} a the vector to transform
- * @param {ReadonlyQuat} q quaternion to transform with
- * @returns {vec3} out
- */
- function transformQuat(out, a, q) {
- // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed
- var qx = q[0],
- qy = q[1],
- qz = q[2],
- qw = q[3];
- var x = a[0],
- y = a[1],
- z = a[2]; // var qvec = [qx, qy, qz];
- // var uv = vec3.cross([], qvec, a);
- var uvx = qy * z - qz * y,
- uvy = qz * x - qx * z,
- uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);
- var uuvx = qy * uvz - qz * uvy,
- uuvy = qz * uvx - qx * uvz,
- uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);
- var w2 = qw * 2;
- uvx *= w2;
- uvy *= w2;
- uvz *= w2; // vec3.scale(uuv, uuv, 2);
- uuvx *= 2;
- uuvy *= 2;
- uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));
- out[0] = x + uvx + uuvx;
- out[1] = y + uvy + uuvy;
- out[2] = z + uvz + uuvz;
- return out;
- }
- /**
- * Rotate a 3D vector around the x-axis
- * @param {vec3} out The receiving vec3
- * @param {ReadonlyVec3} a The vec3 point to rotate
- * @param {ReadonlyVec3} b The origin of the rotation
- * @param {Number} rad The angle of rotation in radians
- * @returns {vec3} out
- */
- function rotateX(out, a, b, rad) {
- var p = [],
- r = []; //Translate point to the origin
- p[0] = a[0] - b[0];
- p[1] = a[1] - b[1];
- p[2] = a[2] - b[2]; //perform rotation
- r[0] = p[0];
- r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);
- r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position
- out[0] = r[0] + b[0];
- out[1] = r[1] + b[1];
- out[2] = r[2] + b[2];
- return out;
- }
- /**
- * Rotate a 3D vector around the y-axis
- * @param {vec3} out The receiving vec3
- * @param {ReadonlyVec3} a The vec3 point to rotate
- * @param {ReadonlyVec3} b The origin of the rotation
- * @param {Number} rad The angle of rotation in radians
- * @returns {vec3} out
- */
- function rotateY(out, a, b, rad) {
- var p = [],
- r = []; //Translate point to the origin
- p[0] = a[0] - b[0];
- p[1] = a[1] - b[1];
- p[2] = a[2] - b[2]; //perform rotation
- r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);
- r[1] = p[1];
- r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position
- out[0] = r[0] + b[0];
- out[1] = r[1] + b[1];
- out[2] = r[2] + b[2];
- return out;
- }
- /**
- * Rotate a 3D vector around the z-axis
- * @param {vec3} out The receiving vec3
- * @param {ReadonlyVec3} a The vec3 point to rotate
- * @param {ReadonlyVec3} b The origin of the rotation
- * @param {Number} rad The angle of rotation in radians
- * @returns {vec3} out
- */
- function rotateZ(out, a, b, rad) {
- var p = [],
- r = []; //Translate point to the origin
- p[0] = a[0] - b[0];
- p[1] = a[1] - b[1];
- p[2] = a[2] - b[2]; //perform rotation
- r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);
- r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);
- r[2] = p[2]; //translate to correct position
- out[0] = r[0] + b[0];
- out[1] = r[1] + b[1];
- out[2] = r[2] + b[2];
- return out;
- }
- /**
- * Get the angle between two 3D vectors
- * @param {ReadonlyVec3} a The first operand
- * @param {ReadonlyVec3} b The second operand
- * @returns {Number} The angle in radians
- */
- function angle(a, b) {
- var ax = a[0],
- ay = a[1],
- az = a[2],
- bx = b[0],
- by = b[1],
- bz = b[2],
- mag1 = Math.sqrt(ax * ax + ay * ay + az * az),
- mag2 = Math.sqrt(bx * bx + by * by + bz * bz),
- mag = mag1 * mag2,
- cosine = mag && dot(a, b) / mag;
- return Math.acos(Math.min(Math.max(cosine, -1), 1));
- }
- /**
- * Set the components of a vec3 to zero
- *
- * @param {vec3} out the receiving vector
- * @returns {vec3} out
- */
- function zero(out) {
- out[0] = 0.0;
- out[1] = 0.0;
- out[2] = 0.0;
- return out;
- }
- /**
- * Returns a string representation of a vector
- *
- * @param {ReadonlyVec3} a vector to represent as a string
- * @returns {String} string representation of the vector
- */
- function str(a) {
- return "vec3(" + a[0] + ", " + a[1] + ", " + a[2] + ")";
- }
- /**
- * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)
- *
- * @param {ReadonlyVec3} a The first vector.
- * @param {ReadonlyVec3} b The second vector.
- * @returns {Boolean} True if the vectors are equal, false otherwise.
- */
- function exactEquals(a, b) {
- return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
- }
- /**
- * Returns whether or not the vectors have approximately the same elements in the same position.
- *
- * @param {ReadonlyVec3} a The first vector.
- * @param {ReadonlyVec3} b The second vector.
- * @returns {Boolean} True if the vectors are equal, false otherwise.
- */
- function equals(a, b) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2];
- var b0 = b[0],
- b1 = b[1],
- b2 = b[2];
- return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2));
- }
- /**
- * Alias for {@link vec3.subtract}
- * @function
- */
- var sub = subtract;
- /**
- * Alias for {@link vec3.multiply}
- * @function
- */
- var mul = multiply;
- /**
- * Alias for {@link vec3.divide}
- * @function
- */
- var div = divide;
- /**
- * Alias for {@link vec3.distance}
- * @function
- */
- var dist = distance;
- /**
- * Alias for {@link vec3.squaredDistance}
- * @function
- */
- var sqrDist = squaredDistance;
- /**
- * Alias for {@link vec3.length}
- * @function
- */
- var len = length;
- /**
- * Alias for {@link vec3.squaredLength}
- * @function
- */
- var sqrLen = squaredLength;
- /**
- * Perform some operation over an array of vec3s.
- *
- * @param {Array} a the array of vectors to iterate over
- * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed
- * @param {Number} offset Number of elements to skip at the beginning of the array
- * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array
- * @param {Function} fn Function to call for each vector in the array
- * @param {Object} [arg] additional argument to pass to fn
- * @returns {Array} a
- * @function
- */
- var forEach = function () {
- var vec = create();
- return function (a, stride, offset, count, fn, arg) {
- var i, l;
- if (!stride) {
- stride = 3;
- }
- if (!offset) {
- offset = 0;
- }
- if (count) {
- l = Math.min(count * stride + offset, a.length);
- } else {
- l = a.length;
- }
- for (i = offset; i < l; i += stride) {
- vec[0] = a[i];
- vec[1] = a[i + 1];
- vec[2] = a[i + 2];
- fn(vec, vec, arg);
- a[i] = vec[0];
- a[i + 1] = vec[1];
- a[i + 2] = vec[2];
- }
- return a;
- };
- }();
- /***/ }),
- /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec4.js":
- /*!*************************************************************!*\
- !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec4.js ***!
- \*************************************************************/
- /*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat4, transformQuat, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return divide; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return ceil; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return floor; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "round", function() { return round; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scaleAndAdd", function() { return scaleAndAdd; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distance", function() { return distance; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredDistance", function() { return squaredDistance; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "length", function() { return length; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredLength", function() { return squaredLength; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return negate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inverse", function() { return inverse; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return dot; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cross", function() { return cross; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return lerp; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return random; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat4", function() { return transformMat4; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformQuat", function() { return transformQuat; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zero", function() { return zero; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "div", function() { return div; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dist", function() { return dist; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrDist", function() { return sqrDist; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "len", function() { return len; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrLen", function() { return sqrLen; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; });
- /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
- /**
- * 4 Dimensional Vector
- * @module vec4
- */
- /**
- * Creates a new, empty vec4
- *
- * @returns {vec4} a new 4D vector
- */
- function create() {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
- if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
- out[0] = 0;
- out[1] = 0;
- out[2] = 0;
- out[3] = 0;
- }
- return out;
- }
- /**
- * Creates a new vec4 initialized with values from an existing vector
- *
- * @param {ReadonlyVec4} a vector to clone
- * @returns {vec4} a new 4D vector
- */
- function clone(a) {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- return out;
- }
- /**
- * Creates a new vec4 initialized with the given values
- *
- * @param {Number} x X component
- * @param {Number} y Y component
- * @param {Number} z Z component
- * @param {Number} w W component
- * @returns {vec4} a new 4D vector
- */
- function fromValues(x, y, z, w) {
- var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
- out[0] = x;
- out[1] = y;
- out[2] = z;
- out[3] = w;
- return out;
- }
- /**
- * Copy the values from one vec4 to another
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a the source vector
- * @returns {vec4} out
- */
- function copy(out, a) {
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- return out;
- }
- /**
- * Set the components of a vec4 to the given values
- *
- * @param {vec4} out the receiving vector
- * @param {Number} x X component
- * @param {Number} y Y component
- * @param {Number} z Z component
- * @param {Number} w W component
- * @returns {vec4} out
- */
- function set(out, x, y, z, w) {
- out[0] = x;
- out[1] = y;
- out[2] = z;
- out[3] = w;
- return out;
- }
- /**
- * Adds two vec4's
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a the first operand
- * @param {ReadonlyVec4} b the second operand
- * @returns {vec4} out
- */
- function add(out, a, b) {
- out[0] = a[0] + b[0];
- out[1] = a[1] + b[1];
- out[2] = a[2] + b[2];
- out[3] = a[3] + b[3];
- return out;
- }
- /**
- * Subtracts vector b from vector a
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a the first operand
- * @param {ReadonlyVec4} b the second operand
- * @returns {vec4} out
- */
- function subtract(out, a, b) {
- out[0] = a[0] - b[0];
- out[1] = a[1] - b[1];
- out[2] = a[2] - b[2];
- out[3] = a[3] - b[3];
- return out;
- }
- /**
- * Multiplies two vec4's
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a the first operand
- * @param {ReadonlyVec4} b the second operand
- * @returns {vec4} out
- */
- function multiply(out, a, b) {
- out[0] = a[0] * b[0];
- out[1] = a[1] * b[1];
- out[2] = a[2] * b[2];
- out[3] = a[3] * b[3];
- return out;
- }
- /**
- * Divides two vec4's
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a the first operand
- * @param {ReadonlyVec4} b the second operand
- * @returns {vec4} out
- */
- function divide(out, a, b) {
- out[0] = a[0] / b[0];
- out[1] = a[1] / b[1];
- out[2] = a[2] / b[2];
- out[3] = a[3] / b[3];
- return out;
- }
- /**
- * Math.ceil the components of a vec4
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a vector to ceil
- * @returns {vec4} out
- */
- function ceil(out, a) {
- out[0] = Math.ceil(a[0]);
- out[1] = Math.ceil(a[1]);
- out[2] = Math.ceil(a[2]);
- out[3] = Math.ceil(a[3]);
- return out;
- }
- /**
- * Math.floor the components of a vec4
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a vector to floor
- * @returns {vec4} out
- */
- function floor(out, a) {
- out[0] = Math.floor(a[0]);
- out[1] = Math.floor(a[1]);
- out[2] = Math.floor(a[2]);
- out[3] = Math.floor(a[3]);
- return out;
- }
- /**
- * Returns the minimum of two vec4's
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a the first operand
- * @param {ReadonlyVec4} b the second operand
- * @returns {vec4} out
- */
- function min(out, a, b) {
- out[0] = Math.min(a[0], b[0]);
- out[1] = Math.min(a[1], b[1]);
- out[2] = Math.min(a[2], b[2]);
- out[3] = Math.min(a[3], b[3]);
- return out;
- }
- /**
- * Returns the maximum of two vec4's
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a the first operand
- * @param {ReadonlyVec4} b the second operand
- * @returns {vec4} out
- */
- function max(out, a, b) {
- out[0] = Math.max(a[0], b[0]);
- out[1] = Math.max(a[1], b[1]);
- out[2] = Math.max(a[2], b[2]);
- out[3] = Math.max(a[3], b[3]);
- return out;
- }
- /**
- * Math.round the components of a vec4
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a vector to round
- * @returns {vec4} out
- */
- function round(out, a) {
- out[0] = Math.round(a[0]);
- out[1] = Math.round(a[1]);
- out[2] = Math.round(a[2]);
- out[3] = Math.round(a[3]);
- return out;
- }
- /**
- * Scales a vec4 by a scalar number
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a the vector to scale
- * @param {Number} b amount to scale the vector by
- * @returns {vec4} out
- */
- function scale(out, a, b) {
- out[0] = a[0] * b;
- out[1] = a[1] * b;
- out[2] = a[2] * b;
- out[3] = a[3] * b;
- return out;
- }
- /**
- * Adds two vec4's after scaling the second operand by a scalar value
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a the first operand
- * @param {ReadonlyVec4} b the second operand
- * @param {Number} scale the amount to scale b by before adding
- * @returns {vec4} out
- */
- function scaleAndAdd(out, a, b, scale) {
- out[0] = a[0] + b[0] * scale;
- out[1] = a[1] + b[1] * scale;
- out[2] = a[2] + b[2] * scale;
- out[3] = a[3] + b[3] * scale;
- return out;
- }
- /**
- * Calculates the euclidian distance between two vec4's
- *
- * @param {ReadonlyVec4} a the first operand
- * @param {ReadonlyVec4} b the second operand
- * @returns {Number} distance between a and b
- */
- function distance(a, b) {
- var x = b[0] - a[0];
- var y = b[1] - a[1];
- var z = b[2] - a[2];
- var w = b[3] - a[3];
- return Math.hypot(x, y, z, w);
- }
- /**
- * Calculates the squared euclidian distance between two vec4's
- *
- * @param {ReadonlyVec4} a the first operand
- * @param {ReadonlyVec4} b the second operand
- * @returns {Number} squared distance between a and b
- */
- function squaredDistance(a, b) {
- var x = b[0] - a[0];
- var y = b[1] - a[1];
- var z = b[2] - a[2];
- var w = b[3] - a[3];
- return x * x + y * y + z * z + w * w;
- }
- /**
- * Calculates the length of a vec4
- *
- * @param {ReadonlyVec4} a vector to calculate length of
- * @returns {Number} length of a
- */
- function length(a) {
- var x = a[0];
- var y = a[1];
- var z = a[2];
- var w = a[3];
- return Math.hypot(x, y, z, w);
- }
- /**
- * Calculates the squared length of a vec4
- *
- * @param {ReadonlyVec4} a vector to calculate squared length of
- * @returns {Number} squared length of a
- */
- function squaredLength(a) {
- var x = a[0];
- var y = a[1];
- var z = a[2];
- var w = a[3];
- return x * x + y * y + z * z + w * w;
- }
- /**
- * Negates the components of a vec4
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a vector to negate
- * @returns {vec4} out
- */
- function negate(out, a) {
- out[0] = -a[0];
- out[1] = -a[1];
- out[2] = -a[2];
- out[3] = -a[3];
- return out;
- }
- /**
- * Returns the inverse of the components of a vec4
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a vector to invert
- * @returns {vec4} out
- */
- function inverse(out, a) {
- out[0] = 1.0 / a[0];
- out[1] = 1.0 / a[1];
- out[2] = 1.0 / a[2];
- out[3] = 1.0 / a[3];
- return out;
- }
- /**
- * Normalize a vec4
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a vector to normalize
- * @returns {vec4} out
- */
- function normalize(out, a) {
- var x = a[0];
- var y = a[1];
- var z = a[2];
- var w = a[3];
- var len = x * x + y * y + z * z + w * w;
- if (len > 0) {
- len = 1 / Math.sqrt(len);
- }
- out[0] = x * len;
- out[1] = y * len;
- out[2] = z * len;
- out[3] = w * len;
- return out;
- }
- /**
- * Calculates the dot product of two vec4's
- *
- * @param {ReadonlyVec4} a the first operand
- * @param {ReadonlyVec4} b the second operand
- * @returns {Number} dot product of a and b
- */
- function dot(a, b) {
- return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
- }
- /**
- * Returns the cross-product of three vectors in a 4-dimensional space
- *
- * @param {ReadonlyVec4} result the receiving vector
- * @param {ReadonlyVec4} U the first vector
- * @param {ReadonlyVec4} V the second vector
- * @param {ReadonlyVec4} W the third vector
- * @returns {vec4} result
- */
- function cross(out, u, v, w) {
- var A = v[0] * w[1] - v[1] * w[0],
- B = v[0] * w[2] - v[2] * w[0],
- C = v[0] * w[3] - v[3] * w[0],
- D = v[1] * w[2] - v[2] * w[1],
- E = v[1] * w[3] - v[3] * w[1],
- F = v[2] * w[3] - v[3] * w[2];
- var G = u[0];
- var H = u[1];
- var I = u[2];
- var J = u[3];
- out[0] = H * F - I * E + J * D;
- out[1] = -(G * F) + I * C - J * B;
- out[2] = G * E - H * C + J * A;
- out[3] = -(G * D) + H * B - I * A;
- return out;
- }
- /**
- * Performs a linear interpolation between two vec4's
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a the first operand
- * @param {ReadonlyVec4} b the second operand
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
- * @returns {vec4} out
- */
- function lerp(out, a, b, t) {
- var ax = a[0];
- var ay = a[1];
- var az = a[2];
- var aw = a[3];
- out[0] = ax + t * (b[0] - ax);
- out[1] = ay + t * (b[1] - ay);
- out[2] = az + t * (b[2] - az);
- out[3] = aw + t * (b[3] - aw);
- return out;
- }
- /**
- * Generates a random vector with the given scale
- *
- * @param {vec4} out the receiving vector
- * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned
- * @returns {vec4} out
- */
- function random(out, scale) {
- scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a
- // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.
- // http://projecteuclid.org/euclid.aoms/1177692644;
- var v1, v2, v3, v4;
- var s1, s2;
- do {
- v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2 - 1;
- v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2 - 1;
- s1 = v1 * v1 + v2 * v2;
- } while (s1 >= 1);
- do {
- v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2 - 1;
- v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2 - 1;
- s2 = v3 * v3 + v4 * v4;
- } while (s2 >= 1);
- var d = Math.sqrt((1 - s1) / s2);
- out[0] = scale * v1;
- out[1] = scale * v2;
- out[2] = scale * v3 * d;
- out[3] = scale * v4 * d;
- return out;
- }
- /**
- * Transforms the vec4 with a mat4.
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a the vector to transform
- * @param {ReadonlyMat4} m matrix to transform with
- * @returns {vec4} out
- */
- function transformMat4(out, a, m) {
- var x = a[0],
- y = a[1],
- z = a[2],
- w = a[3];
- out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;
- out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;
- out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;
- out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;
- return out;
- }
- /**
- * Transforms the vec4 with a quat
- *
- * @param {vec4} out the receiving vector
- * @param {ReadonlyVec4} a the vector to transform
- * @param {ReadonlyQuat} q quaternion to transform with
- * @returns {vec4} out
- */
- function transformQuat(out, a, q) {
- var x = a[0],
- y = a[1],
- z = a[2];
- var qx = q[0],
- qy = q[1],
- qz = q[2],
- qw = q[3]; // calculate quat * vec
- var ix = qw * x + qy * z - qz * y;
- var iy = qw * y + qz * x - qx * z;
- var iz = qw * z + qx * y - qy * x;
- var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat
- out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;
- out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;
- out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;
- out[3] = a[3];
- return out;
- }
- /**
- * Set the components of a vec4 to zero
- *
- * @param {vec4} out the receiving vector
- * @returns {vec4} out
- */
- function zero(out) {
- out[0] = 0.0;
- out[1] = 0.0;
- out[2] = 0.0;
- out[3] = 0.0;
- return out;
- }
- /**
- * Returns a string representation of a vector
- *
- * @param {ReadonlyVec4} a vector to represent as a string
- * @returns {String} string representation of the vector
- */
- function str(a) {
- return "vec4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")";
- }
- /**
- * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)
- *
- * @param {ReadonlyVec4} a The first vector.
- * @param {ReadonlyVec4} b The second vector.
- * @returns {Boolean} True if the vectors are equal, false otherwise.
- */
- function exactEquals(a, b) {
- return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];
- }
- /**
- * Returns whether or not the vectors have approximately the same elements in the same position.
- *
- * @param {ReadonlyVec4} a The first vector.
- * @param {ReadonlyVec4} b The second vector.
- * @returns {Boolean} True if the vectors are equal, false otherwise.
- */
- function equals(a, b) {
- var a0 = a[0],
- a1 = a[1],
- a2 = a[2],
- a3 = a[3];
- var b0 = b[0],
- b1 = b[1],
- b2 = b[2],
- b3 = b[3];
- return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a3), Math.abs(b3));
- }
- /**
- * Alias for {@link vec4.subtract}
- * @function
- */
- var sub = subtract;
- /**
- * Alias for {@link vec4.multiply}
- * @function
- */
- var mul = multiply;
- /**
- * Alias for {@link vec4.divide}
- * @function
- */
- var div = divide;
- /**
- * Alias for {@link vec4.distance}
- * @function
- */
- var dist = distance;
- /**
- * Alias for {@link vec4.squaredDistance}
- * @function
- */
- var sqrDist = squaredDistance;
- /**
- * Alias for {@link vec4.length}
- * @function
- */
- var len = length;
- /**
- * Alias for {@link vec4.squaredLength}
- * @function
- */
- var sqrLen = squaredLength;
- /**
- * Perform some operation over an array of vec4s.
- *
- * @param {Array} a the array of vectors to iterate over
- * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed
- * @param {Number} offset Number of elements to skip at the beginning of the array
- * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array
- * @param {Function} fn Function to call for each vector in the array
- * @param {Object} [arg] additional argument to pass to fn
- * @returns {Array} a
- * @function
- */
- var forEach = function () {
- var vec = create();
- return function (a, stride, offset, count, fn, arg) {
- var i, l;
- if (!stride) {
- stride = 4;
- }
- if (!offset) {
- offset = 0;
- }
- if (count) {
- l = Math.min(count * stride + offset, a.length);
- } else {
- l = a.length;
- }
- for (i = offset; i < l; i += stride) {
- vec[0] = a[i];
- vec[1] = a[i + 1];
- vec[2] = a[i + 2];
- vec[3] = a[i + 3];
- fn(vec, vec, arg);
- a[i] = vec[0];
- a[i + 1] = vec[1];
- a[i + 2] = vec[2];
- a[i + 3] = vec[3];
- }
- return a;
- };
- }();
- /***/ }),
- /***/ "./node_modules/_process@0.11.10@process/browser.js":
- /*!**********************************************************!*\
- !*** ./node_modules/_process@0.11.10@process/browser.js ***!
- \**********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- // shim for using process in browser
- var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it
- // don't break things. But we need to wrap it in a try catch in case it is
- // wrapped in strict mode code which doesn't define any globals. It's inside a
- // function because try/catches deoptimize in certain engines.
- var cachedSetTimeout;
- var cachedClearTimeout;
- function defaultSetTimout() {
- throw new Error('setTimeout has not been defined');
- }
- function defaultClearTimeout() {
- throw new Error('clearTimeout has not been defined');
- }
- (function () {
- try {
- if (typeof setTimeout === 'function') {
- cachedSetTimeout = setTimeout;
- } else {
- cachedSetTimeout = defaultSetTimout;
- }
- } catch (e) {
- cachedSetTimeout = defaultSetTimout;
- }
- try {
- if (typeof clearTimeout === 'function') {
- cachedClearTimeout = clearTimeout;
- } else {
- cachedClearTimeout = defaultClearTimeout;
- }
- } catch (e) {
- cachedClearTimeout = defaultClearTimeout;
- }
- })();
- function runTimeout(fun) {
- if (cachedSetTimeout === setTimeout) {
- //normal enviroments in sane situations
- return setTimeout(fun, 0);
- } // if setTimeout wasn't available but was latter defined
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
- cachedSetTimeout = setTimeout;
- return setTimeout(fun, 0);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedSetTimeout(fun, 0);
- } catch (e) {
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedSetTimeout.call(null, fun, 0);
- } catch (e) {
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
- return cachedSetTimeout.call(this, fun, 0);
- }
- }
- }
- function runClearTimeout(marker) {
- if (cachedClearTimeout === clearTimeout) {
- //normal enviroments in sane situations
- return clearTimeout(marker);
- } // if clearTimeout wasn't available but was latter defined
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
- cachedClearTimeout = clearTimeout;
- return clearTimeout(marker);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedClearTimeout(marker);
- } catch (e) {
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedClearTimeout.call(null, marker);
- } catch (e) {
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
- return cachedClearTimeout.call(this, marker);
- }
- }
- }
- var queue = [];
- var draining = false;
- var currentQueue;
- var queueIndex = -1;
- function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
- }
- function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
- var len = queue.length;
- while (len) {
- currentQueue = queue;
- queue = [];
- while (++queueIndex < len) {
- if (currentQueue) {
- currentQueue[queueIndex].run();
- }
- }
- queueIndex = -1;
- len = queue.length;
- }
- currentQueue = null;
- draining = false;
- runClearTimeout(timeout);
- }
- process.nextTick = function (fun) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
- }
- queue.push(new Item(fun, args));
- if (queue.length === 1 && !draining) {
- runTimeout(drainQueue);
- }
- }; // v8 likes predictible objects
- function Item(fun, array) {
- this.fun = fun;
- this.array = array;
- }
- Item.prototype.run = function () {
- this.fun.apply(null, this.array);
- };
- process.title = 'browser';
- process.browser = true;
- process.env = {};
- process.argv = [];
- process.version = ''; // empty string to avoid regexp issues
- process.versions = {};
- function noop() {}
- process.on = noop;
- process.addListener = noop;
- process.once = noop;
- process.off = noop;
- process.removeListener = noop;
- process.removeAllListeners = noop;
- process.emit = noop;
- process.prependListener = noop;
- process.prependOnceListener = noop;
- process.listeners = function (name) {
- return [];
- };
- process.binding = function (name) {
- throw new Error('process.binding is not supported');
- };
- process.cwd = function () {
- return '/';
- };
- process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
- };
- process.umask = function () {
- return 0;
- };
- /***/ }),
- /***/ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js":
- /*!*******************************************************!*\
- !*** ./node_modules/_tslib@1.13.0@tslib/tslib.es6.js ***!
- \*******************************************************/
- /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__createBinding", function() { return __createBinding; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; });
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */
- /* global Reflect, Promise */
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || {
- __proto__: []
- } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- function __extends(d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- }
- var __assign = function () {
- __assign = Object.assign || function __assign(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
- }
- return t;
- };
- return __assign.apply(this, arguments);
- };
- function __rest(s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- }
- function __decorate(decorators, target, key, desc) {
- var c = arguments.length,
- r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
- d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- }
- function __param(paramIndex, decorator) {
- return function (target, key) {
- decorator(target, key, paramIndex);
- };
- }
- function __metadata(metadataKey, metadataValue) {
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
- }
- function __awaiter(thisArg, _arguments, P, generator) {
- function adopt(value) {
- return value instanceof P ? value : new P(function (resolve) {
- resolve(value);
- });
- }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) {
- try {
- step(generator.next(value));
- } catch (e) {
- reject(e);
- }
- }
- function rejected(value) {
- try {
- step(generator["throw"](value));
- } catch (e) {
- reject(e);
- }
- }
- function step(result) {
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
- }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- }
- function __generator(thisArg, body) {
- var _ = {
- label: 0,
- sent: function () {
- if (t[0] & 1) throw t[1];
- return t[1];
- },
- trys: [],
- ops: []
- },
- f,
- y,
- t,
- g;
- return g = {
- next: verb(0),
- "throw": verb(1),
- "return": verb(2)
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
- return this;
- }), g;
- function verb(n) {
- return function (v) {
- return step([n, v]);
- };
- }
- function step(op) {
- if (f) throw new TypeError("Generator is already executing.");
- while (_) try {
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
- if (y = 0, t) op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0:
- case 1:
- t = op;
- break;
- case 4:
- _.label++;
- return {
- value: op[1],
- done: false
- };
- case 5:
- _.label++;
- y = op[1];
- op = [0];
- continue;
- case 7:
- op = _.ops.pop();
- _.trys.pop();
- continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
- _ = 0;
- continue;
- }
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
- _.label = op[1];
- break;
- }
- if (op[0] === 6 && _.label < t[1]) {
- _.label = t[1];
- t = op;
- break;
- }
- if (t && _.label < t[2]) {
- _.label = t[2];
- _.ops.push(op);
- break;
- }
- if (t[2]) _.ops.pop();
- _.trys.pop();
- continue;
- }
- op = body.call(thisArg, _);
- } catch (e) {
- op = [6, e];
- y = 0;
- } finally {
- f = t = 0;
- }
- if (op[0] & 5) throw op[1];
- return {
- value: op[0] ? op[1] : void 0,
- done: true
- };
- }
- }
- function __createBinding(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
- }
- function __exportStar(m, exports) {
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
- }
- function __values(o) {
- var s = typeof Symbol === "function" && Symbol.iterator,
- m = s && o[s],
- i = 0;
- if (m) return m.call(o);
- if (o && typeof o.length === "number") return {
- next: function () {
- if (o && i >= o.length) o = void 0;
- return {
- value: o && o[i++],
- done: !o
- };
- }
- };
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
- }
- function __read(o, n) {
- var m = typeof Symbol === "function" && o[Symbol.iterator];
- if (!m) return o;
- var i = m.call(o),
- r,
- ar = [],
- e;
- try {
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
- } catch (error) {
- e = {
- error: error
- };
- } finally {
- try {
- if (r && !r.done && (m = i["return"])) m.call(i);
- } finally {
- if (e) throw e.error;
- }
- }
- return ar;
- }
- function __spread() {
- for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
- return ar;
- }
- function __spreadArrays() {
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
- for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
- return r;
- }
- ;
- function __await(v) {
- return this instanceof __await ? (this.v = v, this) : new __await(v);
- }
- function __asyncGenerator(thisArg, _arguments, generator) {
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
- var g = generator.apply(thisArg, _arguments || []),
- i,
- q = [];
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {
- return this;
- }, i;
- function verb(n) {
- if (g[n]) i[n] = function (v) {
- return new Promise(function (a, b) {
- q.push([n, v, a, b]) > 1 || resume(n, v);
- });
- };
- }
- function resume(n, v) {
- try {
- step(g[n](v));
- } catch (e) {
- settle(q[0][3], e);
- }
- }
- function step(r) {
- r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
- }
- function fulfill(value) {
- resume("next", value);
- }
- function reject(value) {
- resume("throw", value);
- }
- function settle(f, v) {
- if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
- }
- }
- function __asyncDelegator(o) {
- var i, p;
- return i = {}, verb("next"), verb("throw", function (e) {
- throw e;
- }), verb("return"), i[Symbol.iterator] = function () {
- return this;
- }, i;
- function verb(n, f) {
- i[n] = o[n] ? function (v) {
- return (p = !p) ? {
- value: __await(o[n](v)),
- done: n === "return"
- } : f ? f(v) : v;
- } : f;
- }
- }
- function __asyncValues(o) {
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
- var m = o[Symbol.asyncIterator],
- i;
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {
- return this;
- }, i);
- function verb(n) {
- i[n] = o[n] && function (v) {
- return new Promise(function (resolve, reject) {
- v = o[n](v), settle(resolve, reject, v.done, v.value);
- });
- };
- }
- function settle(resolve, reject, d, v) {
- Promise.resolve(v).then(function (v) {
- resolve({
- value: v,
- done: d
- });
- }, reject);
- }
- }
- function __makeTemplateObject(cooked, raw) {
- if (Object.defineProperty) {
- Object.defineProperty(cooked, "raw", {
- value: raw
- });
- } else {
- cooked.raw = raw;
- }
- return cooked;
- }
- ;
- function __importStar(mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
- result.default = mod;
- return result;
- }
- function __importDefault(mod) {
- return mod && mod.__esModule ? mod : {
- default: mod
- };
- }
- function __classPrivateFieldGet(receiver, privateMap) {
- if (!privateMap.has(receiver)) {
- throw new TypeError("attempted to get private field on non-instance");
- }
- return privateMap.get(receiver);
- }
- function __classPrivateFieldSet(receiver, privateMap, value) {
- if (!privateMap.has(receiver)) {
- throw new TypeError("attempted to set private field on non-instance");
- }
- privateMap.set(receiver, value);
- return value;
- }
- /***/ }),
- /***/ "./package.json":
- /*!**********************!*\
- !*** ./package.json ***!
- \**********************/
- /*! exports provided: name, version, description, main, module, unpkg, types, files, scripts, repository, keywords, publishConfig, author, license, bugs, devDependencies, homepage, dependencies, __npminstall_done, default */
- /***/ (function(module) {
- module.exports = JSON.parse("{\"name\":\"@antv/g-canvas\",\"version\":\"0.5.0-beta.1\",\"description\":\"A canvas library which providing 2d\",\"main\":\"lib/index.js\",\"module\":\"esm/index.js\",\"unpkg\":\"dist/g.min.js\",\"types\":\"lib/index.d.ts\",\"files\":[\"package.json\",\"esm\",\"lib\",\"dist\",\"LICENSE\",\"README.md\"],\"scripts\":{\"build\":\"npm run clean && run-p build:*\",\"buildx\":\"run-p build:*\",\"build:esm\":\"tsc -p tsconfig.json --target ES5 --module ESNext --outDir esm\",\"build:cjs\":\"tsc -p tsconfig.json --target ES5 --module commonjs --outDir lib\",\"build:umd\":\"webpack --config webpack.config.js --mode development\",\"clean\":\"rm -rf esm lib dist\",\"coverage\":\"npm run coverage-generator && npm run coverage-viewer\",\"coverage-generator\":\"torch --coverage --compile --source-pattern src/*.js,src/**/*.js --opts tests/mocha.opts\",\"coverage-viewer\":\"torch-coverage\",\"test\":\"torch --renderer --compile --opts tests/mocha.opts\",\"test-live\":\"torch --compile --interactive tests/unit/\",\"tsc\":\"tsc --noEmit\",\"typecheck\":\"tsc --noEmit\",\"dist\":\"webpack --config webpack.config.js --mode production\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/antvis/g.git\"},\"keywords\":[\"util\",\"antv\",\"g\"],\"publishConfig\":{\"access\":\"public\"},\"author\":\"https://github.com/orgs/antvis/people\",\"license\":\"ISC\",\"bugs\":{\"url\":\"https://github.com/antvis/g/issues\"},\"devDependencies\":{\"@antv/torch\":\"^1.0.0\",\"less\":\"^3.9.0\",\"npm-run-all\":\"^4.1.5\",\"webpack\":\"^4.26.1\",\"webpack-cli\":\"^3.1.2\"},\"homepage\":\"https://github.com/antvis/g#readme\",\"dependencies\":{\"@antv/g-base\":\"^0.5.0-beta.1\",\"@antv/g-math\":\"^0.1.3\",\"@antv/matrix-util\":\"^3.0.2\",\"@antv/path-util\":\"~2.0.5\",\"@antv/util\":\"~2.0.0\",\"gl-matrix\":\"^3.0.0\"},\"__npminstall_done\":false}");
- /***/ }),
- /***/ "./src/canvas.ts":
- /*!***********************!*\
- !*** ./src/canvas.ts ***!
- \***********************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- var g_base_1 = __webpack_require__(/*! @antv/g-base */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/index.js");
- var hit_1 = __webpack_require__(/*! ./util/hit */ "./src/util/hit.ts");
- var Shape = __webpack_require__(/*! ./shape */ "./src/shape/index.ts");
- var group_1 = __webpack_require__(/*! ./group */ "./src/group.ts");
- var draw_1 = __webpack_require__(/*! ./util/draw */ "./src/util/draw.ts");
- var util_1 = __webpack_require__(/*! ./util/util */ "./src/util/util.ts");
- var Canvas = /** @class */ (function (_super) {
- tslib_1.__extends(Canvas, _super);
- function Canvas() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Canvas.prototype.getDefaultCfg = function () {
- var cfg = _super.prototype.getDefaultCfg.call(this);
- // 设置渲染引擎为 canvas,只读属性
- cfg['renderer'] = 'canvas';
- // 是否自动绘制,不需要用户调用 draw 方法
- cfg['autoDraw'] = true;
- // 是否允许局部刷新图表
- cfg['localRefresh'] = true;
- cfg['refreshElements'] = [];
- // 是否在视图内自动裁剪
- cfg['clipView'] = true;
- // 是否使用快速拾取的方案,默认为 false,上层可以打开
- cfg['quickHit'] = false;
- return cfg;
- };
- /**
- * 一些方法调用会引起画布变化
- * @param {ChangeType} changeType 改变的类型
- */
- Canvas.prototype.onCanvasChange = function (changeType) {
- /**
- * 触发画布更新的三种 changeType
- * 1. attr: 修改画布的绘图属性
- * 2. sort: 画布排序,图形的层次会发生变化
- * 3. changeSize: 改变画布大小
- */
- if (changeType === 'attr' || changeType === 'sort' || changeType === 'changeSize') {
- this.set('refreshElements', [this]);
- this.draw();
- }
- };
- Canvas.prototype.getShapeBase = function () {
- return Shape;
- };
- Canvas.prototype.getGroupBase = function () {
- return group_1.default;
- };
- /**
- * 获取屏幕像素比
- */
- Canvas.prototype.getPixelRatio = function () {
- var pixelRatio = this.get('pixelRatio') || util_1.getPixelRatio();
- // 不足 1 的取 1,超出 1 的取整
- return pixelRatio >= 1 ? Math.floor(pixelRatio) : 1;
- };
- Canvas.prototype.getViewRange = function () {
- return {
- minX: 0,
- minY: 0,
- maxX: this.cfg.width,
- maxY: this.cfg.height,
- };
- };
- // 复写基类的方法生成标签
- Canvas.prototype.createDom = function () {
- var element = document.createElement('canvas');
- var context = element.getContext('2d');
- // 缓存 context 对象
- this.set('context', context);
- return element;
- };
- Canvas.prototype.setDOMSize = function (width, height) {
- _super.prototype.setDOMSize.call(this, width, height);
- var context = this.get('context');
- var el = this.get('el');
- var pixelRatio = this.getPixelRatio();
- el.width = pixelRatio * width;
- el.height = pixelRatio * height;
- // 设置 canvas 元素的宽度和高度,会重置缩放,因此 context.scale 需要在每次设置宽、高后调用
- if (pixelRatio > 1) {
- context.scale(pixelRatio, pixelRatio);
- }
- };
- // 复写基类方法
- Canvas.prototype.clear = function () {
- _super.prototype.clear.call(this);
- this._clearFrame(); // 需要清理掉延迟绘制的帧
- var context = this.get('context');
- var element = this.get('el');
- context.clearRect(0, 0, element.width, element.height);
- };
- Canvas.prototype.getShape = function (x, y) {
- var shape;
- if (this.get('quickHit')) {
- shape = hit_1.getShape(this, x, y);
- }
- else {
- shape = _super.prototype.getShape.call(this, x, y, null);
- }
- return shape;
- };
- // 对绘制区域边缘取整,避免浮点数问题
- Canvas.prototype._getRefreshRegion = function () {
- var elements = this.get('refreshElements');
- var viewRegion = this.getViewRange();
- var region;
- // 如果是当前画布整体发生了变化,则直接重绘整个画布
- if (elements.length && elements[0] === this) {
- region = viewRegion;
- }
- else {
- region = draw_1.getMergedRegion(elements);
- if (region) {
- region.minX = Math.floor(region.minX);
- region.minY = Math.floor(region.minY);
- region.maxX = Math.ceil(region.maxX);
- region.maxY = Math.ceil(region.maxY);
- var clipView = this.get('clipView');
- // 自动裁剪不在 view 内的区域
- if (clipView) {
- region = draw_1.mergeView(region, viewRegion);
- }
- }
- }
- return region;
- };
- /**
- * 刷新图形元素,这里仅仅是放入队列,下次绘制时进行绘制
- * @param {IElement} element 图形元素
- */
- Canvas.prototype.refreshElement = function (element) {
- var refreshElements = this.get('refreshElements');
- refreshElements.push(element);
- // if (this.get('autoDraw')) {
- // this._startDraw();
- // }
- };
- // 清理还在进行的绘制
- Canvas.prototype._clearFrame = function () {
- var drawFrame = this.get('drawFrame');
- if (drawFrame) {
- // 如果全部渲染时,存在局部渲染,则抛弃掉局部渲染
- util_1.clearAnimationFrame(drawFrame);
- this.set('drawFrame', null);
- this.set('refreshElements', []);
- }
- };
- // 手工调用绘制接口
- Canvas.prototype.draw = function () {
- var drawFrame = this.get('drawFrame');
- if (this.get('autoDraw') && drawFrame) {
- return;
- }
- this._startDraw();
- };
- // 绘制所有图形
- Canvas.prototype._drawAll = function () {
- var context = this.get('context');
- var element = this.get('el');
- var children = this.getChildren();
- context.clearRect(0, 0, element.width, element.height);
- draw_1.applyAttrsToContext(context, this);
- draw_1.drawChildren(context, children);
- // 对于 https://github.com/antvis/g/issues/422 的场景,全局渲染的模式下也会记录更新的元素队列,因此全局渲染完后也需要置空
- this.set('refreshElements', []);
- };
- // 绘制局部
- Canvas.prototype._drawRegion = function () {
- var context = this.get('context');
- var children = this.getChildren();
- var region = this._getRefreshRegion();
- var refreshElements = this.get('refreshElements');
- // 需要注意可能没有 region 的场景
- // 一般发生在设置了 localRefresh ,在没有图形发生变化的情况下,用户调用了 draw
- if (region) {
- // 清理指定区域
- context.clearRect(region.minX, region.minY, region.maxX - region.minX, region.maxY - region.minY);
- // 保存上下文,设置 clip
- context.save();
- context.beginPath();
- context.rect(region.minX, region.minY, region.maxX - region.minX, region.maxY - region.minY);
- context.clip();
- draw_1.applyAttrsToContext(context, this);
- // 确认更新的元素,这个优化可以提升 10 倍左右的性能,10W 个带有 group 的节点,局部渲染会从 90ms 下降到 5-6 ms
- draw_1.checkRefresh(this, children, region);
- // 绘制子元素
- draw_1.drawChildren(context, children, region);
- context.restore();
- }
- else if (refreshElements.length) {
- // 防止发生改变的 elements 没有 region 的场景,这会发生在多个情况下
- // 1. 空的 group
- // 2. 所有 elements 没有在绘图区域
- // 3. group 下面的 elements 隐藏掉
- // 如果不进行清理 hasChanged 的状态会不正确
- draw_1.clearChanged(refreshElements);
- }
- this.set('refreshElements', []);
- };
- // 触发绘制
- Canvas.prototype._startDraw = function () {
- var _this = this;
- var drawFrame = this.get('drawFrame');
- if (!drawFrame) {
- drawFrame = util_1.requestAnimationFrame(function () {
- if (_this.get('localRefresh')) {
- _this._drawRegion();
- }
- else {
- _this._drawAll();
- }
- _this.set('drawFrame', null);
- });
- this.set('drawFrame', drawFrame);
- }
- };
- Canvas.prototype.skipDraw = function () { };
- return Canvas;
- }(g_base_1.AbstractCanvas));
- exports.default = Canvas;
- /***/ }),
- /***/ "./src/group.ts":
- /*!**********************!*\
- !*** ./src/group.ts ***!
- \**********************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- var g_base_1 = __webpack_require__(/*! @antv/g-base */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/index.js");
- var Shape = __webpack_require__(/*! ./shape */ "./src/shape/index.ts");
- var draw_1 = __webpack_require__(/*! ./util/draw */ "./src/util/draw.ts");
- var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
- var util_2 = __webpack_require__(/*! ./util/util */ "./src/util/util.ts");
- var Group = /** @class */ (function (_super) {
- tslib_1.__extends(Group, _super);
- function Group() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * 一些方法调用会引起画布变化
- * @param {ChangeType} changeType 改变的类型
- */
- Group.prototype.onCanvasChange = function (changeType) {
- draw_1.refreshElement(this, changeType);
- };
- Group.prototype.getShapeBase = function () {
- return Shape;
- };
- Group.prototype.getGroupBase = function () {
- return Group;
- };
- // 同 shape 中的方法重复了
- Group.prototype._applyClip = function (context, clip) {
- if (clip) {
- context.save();
- // 将 clip 的属性挂载到 context 上
- draw_1.applyAttrsToContext(context, clip);
- // 绘制 clip 路径
- clip.createPath(context);
- context.restore();
- // 裁剪
- context.clip();
- clip._afterDraw();
- }
- };
- // 这个方法以前直接使用的 getCanvasBBox,由于 group 上没有缓存,所以每次重新计算,导致性能开销比较大
- // 大概能够节省全局渲染 15-20% 的性能,如果不在这里加缓存优化后 10W 个节点无法达到 5-6 ms,大概能够 30-40ms
- Group.prototype.cacheCanvasBBox = function () {
- var children = this.cfg.children;
- var xArr = [];
- var yArr = [];
- util_1.each(children, function (child) {
- var bbox = child.cfg.cacheCanvasBBox;
- // isInview 的判定是一旦图形或者分组渲染就要计算是否在视图内,
- // 这个判定 10W 个图形下差不多能够节省 5-6 ms 的开销
- if (bbox && child.cfg.isInView) {
- xArr.push(bbox.minX, bbox.maxX);
- yArr.push(bbox.minY, bbox.maxY);
- }
- });
- var bbox = null;
- if (xArr.length) {
- var minX = Math.min.apply(null, xArr);
- var maxX = Math.max.apply(null, xArr);
- var minY = Math.min.apply(null, yArr);
- var maxY = Math.max.apply(null, yArr);
- bbox = {
- minX: minX,
- minY: minY,
- x: minX,
- y: minY,
- maxX: maxX,
- maxY: maxY,
- width: maxX - minX,
- height: maxY - minY,
- };
- var canvas = this.cfg.canvas;
- if (canvas) {
- var viewRange = canvas.getViewRange();
- // 如果这个地方判定 isInView == false 设置 bbox 为 false 的话,拾取的性能会更高
- // 但是目前 10W 图形的拾取在 2-5ms 内,这个优化意义不大,可以后期观察再看
- this.set('isInView', util_2.intersectRect(bbox, viewRange));
- }
- }
- else {
- this.set('isInView', false);
- }
- this.set('cacheCanvasBBox', bbox);
- };
- Group.prototype.draw = function (context, region) {
- var children = this.cfg.children;
- var allowDraw = region ? this.cfg.refresh : true; // 局部刷新需要判定
- // 这个地方需要判定,在 G6 的场景每个 group 都有 transform 的场景下性能会开销非常大
- // 通过 refresh 的判定,可以不刷新没有发生过变化的分组,不在视窗内的分组等等
- // 如果想进一步提升局部渲染性能,可以进一步优化 refresh 的判定,依然有潜力
- if (children.length && allowDraw) {
- context.save();
- // group 上的矩阵和属性也会应用到上下文上
- // 先将 attrs 应用到上下文中,再设置 clip。因为 clip 应该被当前元素的 matrix 所影响
- draw_1.applyAttrsToContext(context, this);
- this._applyClip(context, this.getClip());
- draw_1.drawChildren(context, children, region);
- context.restore();
- this.cacheCanvasBBox();
- }
- // 这里的成本比较大,如果不绘制则不再
- // this.set('cacheCanvasBBox', this.getCanvasBBox());
- this.cfg.refresh = null;
- // 绘制后,消除更新标记
- this.set('hasChanged', false);
- };
- // 绘制时被跳过,一般发生在分组隐藏时
- Group.prototype.skipDraw = function () {
- this.set('cacheCanvasBBox', null);
- this.set('hasChanged', false);
- };
- return Group;
- }(g_base_1.AbstractGroup));
- exports.default = Group;
- /***/ }),
- /***/ "./src/index.ts":
- /*!**********************!*\
- !*** ./src/index.ts ***!
- \**********************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.Shape = exports.version = void 0;
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- var Shape = __webpack_require__(/*! ./shape */ "./src/shape/index.ts");
- exports.Shape = Shape;
- var pkg = __webpack_require__(/*! ../package.json */ "./package.json");
- exports.version = pkg.version;
- tslib_1.__exportStar(__webpack_require__(/*! ./types */ "./src/types.ts"), exports);
- tslib_1.__exportStar(__webpack_require__(/*! ./interfaces */ "./src/interfaces.ts"), exports);
- var g_base_1 = __webpack_require__(/*! @antv/g-base */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/index.js");
- Object.defineProperty(exports, "Event", { enumerable: true, get: function () { return g_base_1.Event; } });
- var canvas_1 = __webpack_require__(/*! ./canvas */ "./src/canvas.ts");
- Object.defineProperty(exports, "Canvas", { enumerable: true, get: function () { return canvas_1.default; } });
- var group_1 = __webpack_require__(/*! ./group */ "./src/group.ts");
- Object.defineProperty(exports, "Group", { enumerable: true, get: function () { return group_1.default; } });
- /***/ }),
- /***/ "./src/interfaces.ts":
- /*!***************************!*\
- !*** ./src/interfaces.ts ***!
- \***************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- // 导出 g-base 中的 interfaces
- tslib_1.__exportStar(__webpack_require__(/*! @antv/g-base/lib/interfaces */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/interfaces.js"), exports);
- /***/ }),
- /***/ "./src/shape/base.ts":
- /*!***************************!*\
- !*** ./src/shape/base.ts ***!
- \***************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- var g_base_1 = __webpack_require__(/*! @antv/g-base */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/index.js");
- var util_1 = __webpack_require__(/*! ../util/util */ "./src/util/util.ts");
- var draw_1 = __webpack_require__(/*! ../util/draw */ "./src/util/draw.ts");
- var index_1 = __webpack_require__(/*! @antv/g-base/lib/bbox/index */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/index.js");
- var Shape = __webpack_require__(/*! ./index */ "./src/shape/index.ts");
- var group_1 = __webpack_require__(/*! ../group */ "./src/group.ts");
- var ShapeBase = /** @class */ (function (_super) {
- tslib_1.__extends(ShapeBase, _super);
- function ShapeBase() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- ShapeBase.prototype.getDefaultAttrs = function () {
- var attrs = _super.prototype.getDefaultAttrs.call(this);
- // 设置默认值
- return tslib_1.__assign(tslib_1.__assign({}, attrs), { lineWidth: 1, lineAppendWidth: 0, strokeOpacity: 1, fillOpacity: 1 });
- };
- ShapeBase.prototype.getShapeBase = function () {
- return Shape;
- };
- ShapeBase.prototype.getGroupBase = function () {
- return group_1.default;
- };
- /**
- * 一些方法调用会引起画布变化
- * @param {ChangeType} changeType 改变的类型
- */
- ShapeBase.prototype.onCanvasChange = function (changeType) {
- draw_1.refreshElement(this, changeType);
- };
- ShapeBase.prototype.calculateBBox = function () {
- var type = this.get('type');
- var lineWidth = this.getHitLineWidth();
- // const attrs = this.attr();
- var bboxMethod = index_1.getBBoxMethod(type);
- var box = bboxMethod(this);
- var halfLineWidth = lineWidth / 2;
- var minX = box.x - halfLineWidth;
- var minY = box.y - halfLineWidth;
- var maxX = box.x + box.width + halfLineWidth;
- var maxY = box.y + box.height + halfLineWidth;
- return {
- x: minX,
- minX: minX,
- y: minY,
- minY: minY,
- width: box.width + lineWidth,
- height: box.height + lineWidth,
- maxX: maxX,
- maxY: maxY,
- };
- };
- ShapeBase.prototype.isFill = function () {
- return !!this.attrs['fill'] || this.isClipShape();
- };
- ShapeBase.prototype.isStroke = function () {
- return !!this.attrs['stroke'];
- };
- // 同 shape 中的方法重复了
- ShapeBase.prototype._applyClip = function (context, clip) {
- if (clip) {
- context.save();
- // 将 clip 的属性挂载到 context 上
- draw_1.applyAttrsToContext(context, clip);
- // 绘制 clip 路径
- clip.createPath(context);
- context.restore();
- // 裁剪
- context.clip();
- clip._afterDraw();
- }
- };
- // 绘制图形时需要考虑 region 限制
- ShapeBase.prototype.draw = function (context, region) {
- var clip = this.cfg.clipShape;
- // 如果指定了 region,同时不允许刷新时,直接返回
- if (region) {
- if (this.cfg.refresh === false) {
- // this._afterDraw();
- this.set('hasChanged', false);
- return;
- }
- // 是否相交需要考虑 clip 的包围盒
- var bbox = this.getCanvasBBox();
- if (!util_1.intersectRect(region, bbox)) {
- this.set('hasChanged', false);
- // 存在多种情形需要更新 cacheCanvasBBox 和 isInview 的判定
- // 1. 之前图形在视窗内,但是现在不再视窗内
- // 2. 如果当前的图形以及父元素都没有发生过变化,refresh = false 不会走到这里,所以这里的图形都是父元素发生变化,但是没有在视图内的元素
- if (this.cfg.isInView) {
- this._afterDraw();
- }
- return;
- }
- }
- context.save();
- // 先将 attrs 应用到上下文中,再设置 clip。因为 clip 应该被当前元素的 matrix 所影响
- draw_1.applyAttrsToContext(context, this);
- this._applyClip(context, clip);
- this.drawPath(context);
- context.restore();
- this._afterDraw();
- };
- ShapeBase.prototype.getCanvasViewBox = function () {
- var canvas = this.cfg.canvas;
- if (canvas) {
- // @ts-ignore
- return canvas.getViewRange();
- }
- return null;
- };
- ShapeBase.prototype.cacheCanvasBBox = function () {
- var canvasBBox = this.getCanvasViewBox();
- // 绘制的时候缓存包围盒
- if (canvasBBox) {
- var bbox = this.getCanvasBBox();
- var isInView = util_1.intersectRect(bbox, canvasBBox);
- this.set('isInView', isInView);
- // 不再视窗内 cacheCanvasBBox 设置成 null,会提升局部渲染的性能,
- // 因为在局部渲染影响的包围盒计算时不考虑这个图形的包围盒
- // 父元素 cacheCanvasBBox 计算的时候也不计算
- if (isInView) {
- this.set('cacheCanvasBBox', bbox);
- }
- else {
- this.set('cacheCanvasBBox', null);
- }
- }
- };
- ShapeBase.prototype._afterDraw = function () {
- this.cacheCanvasBBox();
- // 绘制后消除标记
- this.set('hasChanged', false);
- this.set('refresh', null);
- };
- ShapeBase.prototype.skipDraw = function () {
- this.set('cacheCanvasBBox', null);
- this.set('isInView', null);
- this.set('hasChanged', false);
- };
- /**
- * 绘制图形的路径
- * @param {CanvasRenderingContext2D} context 上下文
- */
- ShapeBase.prototype.drawPath = function (context) {
- this.createPath(context);
- this.strokeAndFill(context);
- this.afterDrawPath(context);
- };
- /**
- * @protected
- * 填充图形
- * @param {CanvasRenderingContext2D} context context 上下文
- */
- ShapeBase.prototype.fill = function (context) {
- context.fill();
- };
- /**
- * @protected
- * 绘制图形边框
- * @param {CanvasRenderingContext2D} context context 上下文
- */
- ShapeBase.prototype.stroke = function (context) {
- context.stroke();
- };
- // 绘制或者填充
- ShapeBase.prototype.strokeAndFill = function (context) {
- var _a = this.attrs, lineWidth = _a.lineWidth, opacity = _a.opacity, strokeOpacity = _a.strokeOpacity, fillOpacity = _a.fillOpacity;
- if (this.isFill()) {
- if (!util_1.isNil(fillOpacity) && fillOpacity !== 1) {
- context.globalAlpha = fillOpacity;
- this.fill(context);
- context.globalAlpha = opacity;
- }
- else {
- this.fill(context);
- }
- }
- if (this.isStroke()) {
- if (lineWidth > 0) {
- if (!util_1.isNil(strokeOpacity) && strokeOpacity !== 1) {
- context.globalAlpha = strokeOpacity;
- }
- this.stroke(context);
- }
- }
- this.afterDrawPath(context);
- };
- /**
- * @protected
- * 绘制图形的路径
- * @param {CanvasRenderingContext2D} context 上下文
- */
- ShapeBase.prototype.createPath = function (context) { };
- /**
- * 绘制完成 path 后的操作
- * @param {CanvasRenderingContext2D} context 上下文
- */
- ShapeBase.prototype.afterDrawPath = function (context) { };
- ShapeBase.prototype.isInShape = function (refX, refY) {
- // return HitUtil.isHitShape(this, refX, refY);
- var isStroke = this.isStroke();
- var isFill = this.isFill();
- var lineWidth = this.getHitLineWidth();
- return this.isInStrokeOrPath(refX, refY, isStroke, isFill, lineWidth);
- };
- // 之所以不拆成 isInStroke 和 isInPath 在于两者存在一些共同的计算
- ShapeBase.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
- return false;
- };
- /**
- * 获取线拾取的宽度
- * @returns {number} 线的拾取宽度
- */
- ShapeBase.prototype.getHitLineWidth = function () {
- if (!this.isStroke()) {
- return 0;
- }
- var attrs = this.attrs;
- return attrs['lineWidth'] + attrs['lineAppendWidth'];
- };
- return ShapeBase;
- }(g_base_1.AbstractShape));
- exports.default = ShapeBase;
- /***/ }),
- /***/ "./src/shape/circle.ts":
- /*!*****************************!*\
- !*** ./src/shape/circle.ts ***!
- \*****************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview 圆
- * @author dxq613@gmail.com
- */
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
- var util_1 = __webpack_require__(/*! ../util/util */ "./src/util/util.ts");
- // TODO: 暂时不需要圆的工具方法,后续如果需要支持 pointAt,tangentAngle 时再引入
- // import CircleUtil from '@antv/g-math/lib/circle';
- var Circle = /** @class */ (function (_super) {
- tslib_1.__extends(Circle, _super);
- function Circle() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Circle.prototype.getDefaultAttrs = function () {
- var attrs = _super.prototype.getDefaultAttrs.call(this);
- return tslib_1.__assign(tslib_1.__assign({}, attrs), { x: 0, y: 0, r: 0 });
- };
- Circle.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
- var attrs = this.attr();
- var cx = attrs.x;
- var cy = attrs.y;
- var r = attrs.r;
- var halfLineWidth = lineWidth / 2;
- var absDistance = util_1.distance(cx, cy, x, y);
- // 直接用距离,如果同时存在边和填充时,可以减少两次计算
- if (isFill && isStroke) {
- return absDistance <= r + halfLineWidth;
- }
- if (isFill) {
- return absDistance <= r;
- }
- if (isStroke) {
- return absDistance >= r - halfLineWidth && absDistance <= r + halfLineWidth;
- }
- return false;
- };
- Circle.prototype.createPath = function (context) {
- var attrs = this.attr();
- var cx = attrs.x;
- var cy = attrs.y;
- var r = attrs.r;
- context.beginPath();
- context.arc(cx, cy, r, 0, Math.PI * 2, false);
- context.closePath();
- };
- return Circle;
- }(base_1.default));
- exports.default = Circle;
- /***/ }),
- /***/ "./src/shape/ellipse.ts":
- /*!******************************!*\
- !*** ./src/shape/ellipse.ts ***!
- \******************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview 椭圆
- * @author dxq613@gmail.com
- */
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
- // 暂时不需要
- // import EllipseUtil from '@antv/g-math/lib/ellipse';
- // 根据椭圆公式计算 x*x/rx*rx + y*y/ry*ry;
- function ellipseDistance(squareX, squareY, rx, ry) {
- return squareX / (rx * rx) + squareY / (ry * ry);
- }
- var Ellipse = /** @class */ (function (_super) {
- tslib_1.__extends(Ellipse, _super);
- function Ellipse() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Ellipse.prototype.getDefaultAttrs = function () {
- var attrs = _super.prototype.getDefaultAttrs.call(this);
- return tslib_1.__assign(tslib_1.__assign({}, attrs), { x: 0, y: 0, rx: 0, ry: 0 });
- };
- Ellipse.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
- var attrs = this.attr();
- var halfLineWith = lineWidth / 2;
- var cx = attrs.x;
- var cy = attrs.y;
- var rx = attrs.rx, ry = attrs.ry;
- var squareX = (x - cx) * (x - cx);
- var squareY = (y - cy) * (y - cy);
- // 使用椭圆的公式: x*x/rx*rx + y*y/ry*ry = 1;
- if (isFill && isStroke) {
- return ellipseDistance(squareX, squareY, rx + halfLineWith, ry + halfLineWith) <= 1;
- }
- if (isFill) {
- return ellipseDistance(squareX, squareY, rx, ry) <= 1;
- }
- if (isStroke) {
- return (ellipseDistance(squareX, squareY, rx - halfLineWith, ry - halfLineWith) >= 1 &&
- ellipseDistance(squareX, squareY, rx + halfLineWith, ry + halfLineWith) <= 1);
- }
- return false;
- };
- Ellipse.prototype.createPath = function (context) {
- var attrs = this.attr();
- var cx = attrs.x;
- var cy = attrs.y;
- var rx = attrs.rx;
- var ry = attrs.ry;
- context.beginPath();
- // 兼容逻辑
- if (context.ellipse) {
- context.ellipse(cx, cy, rx, ry, 0, 0, Math.PI * 2, false);
- }
- else {
- // 如果不支持,则使用圆来绘制,进行变形
- var r = rx > ry ? rx : ry;
- var scaleX = rx > ry ? 1 : rx / ry;
- var scaleY = rx > ry ? ry / rx : 1;
- context.save();
- context.translate(cx, cy);
- context.scale(scaleX, scaleY);
- context.arc(0, 0, r, 0, Math.PI * 2);
- context.restore();
- context.closePath();
- }
- };
- return Ellipse;
- }(base_1.default));
- exports.default = Ellipse;
- /***/ }),
- /***/ "./src/shape/image.ts":
- /*!****************************!*\
- !*** ./src/shape/image.ts ***!
- \****************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview 图片
- * @author dxq613@gmail.com
- */
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
- var util_1 = __webpack_require__(/*! ../util/util */ "./src/util/util.ts");
- function isCanvas(dom) {
- return dom instanceof HTMLElement && util_1.isString(dom.nodeName) && dom.nodeName.toUpperCase() === 'CANVAS';
- }
- var ImageShape = /** @class */ (function (_super) {
- tslib_1.__extends(ImageShape, _super);
- function ImageShape() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- ImageShape.prototype.getDefaultAttrs = function () {
- var attrs = _super.prototype.getDefaultAttrs.call(this);
- return tslib_1.__assign(tslib_1.__assign({}, attrs), { x: 0, y: 0, width: 0, height: 0 });
- };
- ImageShape.prototype.initAttrs = function (attrs) {
- this._setImage(attrs.img);
- };
- // image 不计算 stroke
- ImageShape.prototype.isStroke = function () {
- return false;
- };
- // 仅仅使用包围盒检测来进行拾取
- // 所以不需要复写 isInStrokeOrPath 的方法
- ImageShape.prototype.isOnlyHitBox = function () {
- return true;
- };
- ImageShape.prototype._afterLoading = function () {
- if (this.get('toDraw') === true) {
- var canvas = this.get('canvas');
- if (canvas) {
- // 这段应该改成局部渲染
- canvas.draw();
- }
- else {
- // 这种方式如果发生遮挡会出现问题
- this.createPath(this.get('context'));
- }
- }
- };
- ImageShape.prototype._setImage = function (img) {
- var _this = this;
- var attrs = this.attrs;
- if (util_1.isString(img)) {
- var image_1 = new Image();
- image_1.onload = function () {
- // 图片未加载完,则已经被销毁
- if (_this.destroyed) {
- return false;
- }
- // 缓存原始地址,可以做对比,防止重复加载图片
- // 如果考虑到在加载过程中可能替换 img 属性,则情况更加复杂
- // this.set('imgSrc', img);
- // 这里会循环调用 _setImage 方法,但不会再走这个分支
- _this.attr('img', image_1);
- _this.set('loading', false);
- _this._afterLoading();
- var callback = _this.get('callback');
- if (callback) {
- callback.call(_this);
- }
- };
- image_1.src = img;
- // 设置跨域
- image_1.crossOrigin = 'Anonymous';
- // loading 过程中不绘制
- this.set('loading', true);
- }
- else if (img instanceof Image) {
- // 如果是一个 image 对象,则设置宽高
- if (!attrs.width) {
- attrs.width = img.width;
- }
- if (!attrs.height) {
- attrs.height = img.height;
- }
- }
- else if (isCanvas(img)) {
- // 如果设置了 canvas 对象
- if (!attrs.width) {
- attrs.width = Number(img.getAttribute('width'));
- }
- if (!attrs.height) {
- attrs.height, Number(img.getAttribute('height'));
- }
- }
- };
- ImageShape.prototype.onAttrChange = function (name, value, originValue) {
- _super.prototype.onAttrChange.call(this, name, value, originValue);
- // 如果加载的已经是当前图片,则不再处理
- if (name === 'img') {
- // 可以加缓冲,&& this.get('imgSrc') !== value
- this._setImage(value);
- }
- };
- ImageShape.prototype.createPath = function (context) {
- // 正在加载则不绘制
- if (this.get('loading')) {
- this.set('toDraw', true); // 加载完成后绘制
- this.set('context', context);
- return;
- }
- var attrs = this.attr();
- var x = attrs.x, y = attrs.y, width = attrs.width, height = attrs.height, sx = attrs.sx, sy = attrs.sy, swidth = attrs.swidth, sheight = attrs.sheight;
- var img = attrs.img;
- if (img instanceof Image || isCanvas(img)) {
- if (!util_1.isNil(sx) && !util_1.isNil(sy) && !util_1.isNil(swidth) && !util_1.isNil(sheight)) {
- context.drawImage(img, sx, sy, swidth, sheight, x, y, width, height);
- }
- else {
- context.drawImage(img, x, y, width, height);
- }
- }
- };
- return ImageShape;
- }(base_1.default));
- exports.default = ImageShape;
- /***/ }),
- /***/ "./src/shape/index.ts":
- /*!****************************!*\
- !*** ./src/shape/index.ts ***!
- \****************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
- Object.defineProperty(exports, "Base", { enumerable: true, get: function () { return base_1.default; } });
- var circle_1 = __webpack_require__(/*! ./circle */ "./src/shape/circle.ts");
- Object.defineProperty(exports, "Circle", { enumerable: true, get: function () { return circle_1.default; } });
- var ellipse_1 = __webpack_require__(/*! ./ellipse */ "./src/shape/ellipse.ts");
- Object.defineProperty(exports, "Ellipse", { enumerable: true, get: function () { return ellipse_1.default; } });
- var image_1 = __webpack_require__(/*! ./image */ "./src/shape/image.ts");
- Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return image_1.default; } });
- var line_1 = __webpack_require__(/*! ./line */ "./src/shape/line.ts");
- Object.defineProperty(exports, "Line", { enumerable: true, get: function () { return line_1.default; } });
- var marker_1 = __webpack_require__(/*! ./marker */ "./src/shape/marker.ts");
- Object.defineProperty(exports, "Marker", { enumerable: true, get: function () { return marker_1.default; } });
- var path_1 = __webpack_require__(/*! ./path */ "./src/shape/path.ts");
- Object.defineProperty(exports, "Path", { enumerable: true, get: function () { return path_1.default; } });
- var polygon_1 = __webpack_require__(/*! ./polygon */ "./src/shape/polygon.ts");
- Object.defineProperty(exports, "Polygon", { enumerable: true, get: function () { return polygon_1.default; } });
- var polyline_1 = __webpack_require__(/*! ./polyline */ "./src/shape/polyline.ts");
- Object.defineProperty(exports, "Polyline", { enumerable: true, get: function () { return polyline_1.default; } });
- var rect_1 = __webpack_require__(/*! ./rect */ "./src/shape/rect.ts");
- Object.defineProperty(exports, "Rect", { enumerable: true, get: function () { return rect_1.default; } });
- var text_1 = __webpack_require__(/*! ./text */ "./src/shape/text.ts");
- Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return text_1.default; } });
- /***/ }),
- /***/ "./src/shape/line.ts":
- /*!***************************!*\
- !*** ./src/shape/line.ts ***!
- \***************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- /**
- * @fileoverview 圆
- * @author dxq613@gmail.com
- */
- var line_1 = __webpack_require__(/*! @antv/g-math/lib/line */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js");
- var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
- var line_2 = __webpack_require__(/*! ../util/in-stroke/line */ "./src/util/in-stroke/line.ts");
- var ArrowUtil = __webpack_require__(/*! ../util/arrow */ "./src/util/arrow.ts");
- var Line = /** @class */ (function (_super) {
- tslib_1.__extends(Line, _super);
- function Line() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Line.prototype.getDefaultAttrs = function () {
- var attrs = _super.prototype.getDefaultAttrs.call(this);
- return tslib_1.__assign(tslib_1.__assign({}, attrs), { x1: 0, y1: 0, x2: 0, y2: 0, startArrow: false, endArrow: false });
- };
- Line.prototype.initAttrs = function (attrs) {
- this.setArrow();
- };
- // 更新属性时,检测是否更改了箭头
- Line.prototype.onAttrChange = function (name, value, originValue) {
- _super.prototype.onAttrChange.call(this, name, value, originValue);
- // 由于箭头的绘制依赖于 line 的诸多 attrs,因此这里不再对每个 attr 进行判断,attr 每次变化都会影响箭头的更新
- this.setArrow();
- };
- Line.prototype.setArrow = function () {
- var attrs = this.attr();
- var x1 = attrs.x1, y1 = attrs.y1, x2 = attrs.x2, y2 = attrs.y2, startArrow = attrs.startArrow, endArrow = attrs.endArrow;
- if (startArrow) {
- ArrowUtil.addStartArrow(this, attrs, x2, y2, x1, y1);
- }
- if (endArrow) {
- ArrowUtil.addEndArrow(this, attrs, x1, y1, x2, y2);
- }
- };
- Line.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
- if (!isStroke || !lineWidth) {
- return false;
- }
- var _a = this.attr(), x1 = _a.x1, y1 = _a.y1, x2 = _a.x2, y2 = _a.y2;
- return line_2.default(x1, y1, x2, y2, lineWidth, x, y);
- };
- Line.prototype.createPath = function (context) {
- var attrs = this.attr();
- var x1 = attrs.x1, y1 = attrs.y1, x2 = attrs.x2, y2 = attrs.y2, startArrow = attrs.startArrow, endArrow = attrs.endArrow;
- var startArrowDistance = {
- dx: 0,
- dy: 0,
- };
- var endArrowDistance = {
- dx: 0,
- dy: 0,
- };
- if (startArrow && startArrow.d) {
- startArrowDistance = ArrowUtil.getShortenOffset(x1, y1, x2, y2, attrs.startArrow.d);
- }
- if (endArrow && endArrow.d) {
- endArrowDistance = ArrowUtil.getShortenOffset(x1, y1, x2, y2, attrs.endArrow.d);
- }
- context.beginPath();
- // 如果自定义箭头,线条相应缩进
- context.moveTo(x1 + startArrowDistance.dx, y1 + startArrowDistance.dy);
- context.lineTo(x2 - endArrowDistance.dx, y2 - endArrowDistance.dy);
- };
- Line.prototype.afterDrawPath = function (context) {
- var startArrowShape = this.get('startArrowShape');
- var endArrowShape = this.get('endArrowShape');
- if (startArrowShape) {
- startArrowShape.draw(context);
- }
- if (endArrowShape) {
- endArrowShape.draw(context);
- }
- };
- /**
- * Get length of line
- * @return {number} length
- */
- Line.prototype.getTotalLength = function () {
- var _a = this.attr(), x1 = _a.x1, y1 = _a.y1, x2 = _a.x2, y2 = _a.y2;
- return line_1.default.length(x1, y1, x2, y2);
- };
- /**
- * Get point according to ratio
- * @param {number} ratio
- * @return {Point} point
- */
- Line.prototype.getPoint = function (ratio) {
- var _a = this.attr(), x1 = _a.x1, y1 = _a.y1, x2 = _a.x2, y2 = _a.y2;
- return line_1.default.pointAt(x1, y1, x2, y2, ratio);
- };
- return Line;
- }(base_1.default));
- exports.default = Line;
- /***/ }),
- /***/ "./src/shape/marker.ts":
- /*!*****************************!*\
- !*** ./src/shape/marker.ts ***!
- \*****************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Marker
- * @author dxq613@gmail.com
- */
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
- var path_2_absolute_1 = __webpack_require__(/*! @antv/path-util/lib/path-2-absolute */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-absolute.js");
- var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
- var util_2 = __webpack_require__(/*! ../util/util */ "./src/util/util.ts");
- var draw_1 = __webpack_require__(/*! ../util/draw */ "./src/util/draw.ts");
- var Symbols = {
- // 圆
- circle: function (x, y, r) {
- return [
- ['M', x - r, y],
- ['A', r, r, 0, 1, 0, x + r, y],
- ['A', r, r, 0, 1, 0, x - r, y],
- ];
- },
- // 正方形
- square: function (x, y, r) {
- return [['M', x - r, y - r], ['L', x + r, y - r], ['L', x + r, y + r], ['L', x - r, y + r], ['Z']];
- },
- // 菱形
- diamond: function (x, y, r) {
- return [['M', x - r, y], ['L', x, y - r], ['L', x + r, y], ['L', x, y + r], ['Z']];
- },
- // 三角形
- triangle: function (x, y, r) {
- var diffY = r * Math.sin((1 / 3) * Math.PI);
- return [['M', x - r, y + diffY], ['L', x, y - diffY], ['L', x + r, y + diffY], ['Z']];
- },
- // 倒三角形
- 'triangle-down': function (x, y, r) {
- var diffY = r * Math.sin((1 / 3) * Math.PI);
- return [['M', x - r, y - diffY], ['L', x + r, y - diffY], ['L', x, y + diffY], ['Z']];
- },
- };
- var Marker = /** @class */ (function (_super) {
- tslib_1.__extends(Marker, _super);
- function Marker() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Marker.prototype.initAttrs = function (attrs) {
- this._resetParamsCache();
- };
- // 重置绘制 path 存储的缓存
- Marker.prototype._resetParamsCache = function () {
- // 为了加速 path 的绘制、拾取和计算,这个地方可以缓存很多东西
- // 这些缓存都是第一次需要时计算和存储,虽然增加了复杂度,但是频繁调用的方法,性能有很大提升
- this.set('paramsCache', {}); // 清理缓存
- };
- // 更新属性时,检测是否更改了 path
- Marker.prototype.onAttrChange = function (name, value, originValue) {
- _super.prototype.onAttrChange.call(this, name, value, originValue);
- if (['symbol', 'x', 'y', 'r', 'radius'].indexOf(name) !== -1) {
- // path 相关属性更改时,清理缓存
- this._resetParamsCache();
- }
- };
- // 仅仅使用包围盒检测来进行拾取
- // 所以不需要复写 isInStrokeOrPath 的方法
- Marker.prototype.isOnlyHitBox = function () {
- return true;
- };
- Marker.prototype._getR = function (attrs) {
- // 兼容 r 和 radius 两种写法,推荐使用 r
- return util_1.isNil(attrs.r) ? attrs.radius : attrs.r;
- };
- Marker.prototype._getPath = function () {
- var attrs = this.attr();
- var x = attrs.x, y = attrs.y;
- var symbol = attrs.symbol || 'circle';
- var r = this._getR(attrs);
- var method;
- var path;
- if (util_2.isFunction(symbol)) {
- method = symbol;
- path = method(x, y, r);
- // 将 path 转成绝对路径
- path = path_2_absolute_1.default(path);
- }
- else {
- // 内置 symbol 的 path 都是绝对路径,直接绘制即可,不需要对 path 进行特殊处理
- method = Marker.Symbols[symbol];
- path = method(x, y, r);
- }
- if (!method) {
- console.warn(symbol + " marker is not supported.");
- return null;
- }
- return path;
- };
- Marker.prototype.createPath = function (context) {
- var path = this._getPath();
- var paramsCache = this.get('paramsCache');
- draw_1.drawPath(this, context, { path: path }, paramsCache);
- };
- Marker.Symbols = Symbols;
- return Marker;
- }(base_1.default));
- exports.default = Marker;
- /***/ }),
- /***/ "./src/shape/path.ts":
- /*!***************************!*\
- !*** ./src/shape/path.ts ***!
- \***************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- var cubic_1 = __webpack_require__(/*! @antv/g-math/lib/cubic */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/cubic.js");
- var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
- var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
- var path_2_absolute_1 = __webpack_require__(/*! @antv/path-util/lib/path-2-absolute */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-absolute.js");
- var path_2_segments_1 = __webpack_require__(/*! @antv/path-util/lib/path-2-segments */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-segments.js");
- var draw_1 = __webpack_require__(/*! ../util/draw */ "./src/util/draw.ts");
- var point_in_path_1 = __webpack_require__(/*! ../util/in-path/point-in-path */ "./src/util/in-path/point-in-path.ts");
- var polygon_1 = __webpack_require__(/*! ../util/in-path/polygon */ "./src/util/in-path/polygon.ts");
- var path_1 = __webpack_require__(/*! ../util/path */ "./src/util/path.ts");
- var ArrowUtil = __webpack_require__(/*! ../util/arrow */ "./src/util/arrow.ts");
- // 是否在多个多边形内部
- function isInPolygons(polygons, x, y) {
- var isHit = false;
- for (var i = 0; i < polygons.length; i++) {
- var points = polygons[i];
- isHit = polygon_1.default(points, x, y);
- if (isHit) {
- break;
- }
- }
- return isHit;
- }
- var Path = /** @class */ (function (_super) {
- tslib_1.__extends(Path, _super);
- function Path() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Path.prototype.getDefaultAttrs = function () {
- var attrs = _super.prototype.getDefaultAttrs.call(this);
- return tslib_1.__assign(tslib_1.__assign({}, attrs), { startArrow: false, endArrow: false });
- };
- Path.prototype.initAttrs = function (attrs) {
- this._setPathArr(attrs.path);
- this.setArrow();
- };
- // 更新属性时,检测是否更改了 path
- Path.prototype.onAttrChange = function (name, value, originValue) {
- _super.prototype.onAttrChange.call(this, name, value, originValue);
- if (name === 'path') {
- this._setPathArr(value);
- }
- // 由于箭头的绘制依赖于 line 的诸多 attrs,因此这里不再对每个 attr 进行判断,attr 每次变化都会影响箭头的更新
- this.setArrow();
- };
- // 将 path 转换成绝对路径
- Path.prototype._setPathArr = function (path) {
- // 转换 path 的格式
- this.attrs.path = path_2_absolute_1.default(path);
- var hasArc = path_1.default.hasArc(path);
- // 为了加速 path 的绘制、拾取和计算,这个地方可以缓存很多东西
- // 这些缓存都是第一次需要时计算和存储,虽然增加了复杂度,但是频繁调用的方法,性能有很大提升
- this.set('hasArc', hasArc);
- this.set('paramsCache', {}); // 清理缓存
- this.set('segments', null); // 延迟生成 path,在动画场景下可能不会有拾取
- this.set('curve', null);
- this.set('tCache', null);
- this.set('totalLength', null);
- };
- Path.prototype.getSegments = function () {
- var segments = this.get('segements');
- if (!segments) {
- segments = path_2_segments_1.default(this.attr('path'));
- this.set('segments', segments);
- }
- return segments;
- };
- Path.prototype.setArrow = function () {
- var attrs = this.attr();
- var startArrow = attrs.startArrow, endArrow = attrs.endArrow;
- if (startArrow) {
- var tangent = this.getStartTangent();
- ArrowUtil.addStartArrow(this, attrs, tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1]);
- }
- if (endArrow) {
- var tangent = this.getEndTangent();
- ArrowUtil.addEndArrow(this, attrs, tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1]);
- }
- };
- Path.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
- var segments = this.getSegments();
- var hasArc = this.get('hasArc');
- var isHit = false;
- if (isStroke) {
- isHit = path_1.default.isPointInStroke(segments, lineWidth, x, y);
- }
- if (!isHit && isFill) {
- if (hasArc) {
- // 存在曲线时,暂时使用 canvas 的 api 计算,后续可以进行多边形切割
- isHit = point_in_path_1.default(this, x, y);
- }
- else {
- var path = this.attr('path');
- var extractResutl = path_1.default.extractPolygons(path);
- // 提取出来的多边形包含闭合的和非闭合的,在这里统一按照多边形处理
- isHit = isInPolygons(extractResutl.polygons, x, y) || isInPolygons(extractResutl.polylines, x, y);
- }
- }
- return isHit;
- };
- Path.prototype.createPath = function (context) {
- var attrs = this.attr();
- var paramsCache = this.get('paramsCache'); // 由于计算圆弧的参数成本很大,所以要缓存
- draw_1.drawPath(this, context, attrs, paramsCache);
- };
- Path.prototype.afterDrawPath = function (context) {
- var startArrowShape = this.get('startArrowShape');
- var endArrowShape = this.get('endArrowShape');
- if (startArrowShape) {
- startArrowShape.draw(context);
- }
- if (endArrowShape) {
- endArrowShape.draw(context);
- }
- };
- /**
- * Get total length of path
- * @return {number} length
- */
- Path.prototype.getTotalLength = function () {
- var totalLength = this.get('totalLength');
- if (!util_1.isNil(totalLength)) {
- return totalLength;
- }
- this._calculateCurve();
- this._setTcache();
- return this.get('totalLength');
- };
- /**
- * Get point according to ratio
- * @param {number} ratio
- * @return {Point} point
- */
- Path.prototype.getPoint = function (ratio) {
- var tCache = this.get('tCache');
- if (!tCache) {
- this._calculateCurve();
- this._setTcache();
- tCache = this.get('tCache');
- }
- var subt;
- var index;
- var curve = this.get('curve');
- if (!tCache || tCache.length === 0) {
- if (curve) {
- return {
- x: curve[0][1],
- y: curve[0][2],
- };
- }
- return null;
- }
- util_1.each(tCache, function (v, i) {
- if (ratio >= v[0] && ratio <= v[1]) {
- subt = (ratio - v[0]) / (v[1] - v[0]);
- index = i;
- }
- });
- var seg = curve[index];
- if (util_1.isNil(seg) || util_1.isNil(index)) {
- return null;
- }
- var l = seg.length;
- var nextSeg = curve[index + 1];
- return cubic_1.default.pointAt(seg[l - 2], seg[l - 1], nextSeg[1], nextSeg[2], nextSeg[3], nextSeg[4], nextSeg[5], nextSeg[6], subt);
- };
- Path.prototype._calculateCurve = function () {
- var path = this.attr().path;
- this.set('curve', path_1.default.pathToCurve(path));
- };
- Path.prototype._setTcache = function () {
- var totalLength = 0;
- var tempLength = 0;
- // 每段 curve 对应起止点的长度比例列表,形如: [[0, 0.25], [0.25, 0.6]. [0.6, 0.9], [0.9, 1]]
- var tCache = [];
- var segmentT;
- var segmentL;
- var segmentN;
- var l;
- var curve = this.get('curve');
- if (!curve) {
- return;
- }
- util_1.each(curve, function (segment, i) {
- segmentN = curve[i + 1];
- l = segment.length;
- if (segmentN) {
- totalLength +=
- cubic_1.default.length(segment[l - 2], segment[l - 1], segmentN[1], segmentN[2], segmentN[3], segmentN[4], segmentN[5], segmentN[6]) || 0;
- }
- });
- this.set('totalLength', totalLength);
- if (totalLength === 0) {
- this.set('tCache', []);
- return;
- }
- util_1.each(curve, function (segment, i) {
- segmentN = curve[i + 1];
- l = segment.length;
- if (segmentN) {
- segmentT = [];
- segmentT[0] = tempLength / totalLength;
- segmentL = cubic_1.default.length(segment[l - 2], segment[l - 1], segmentN[1], segmentN[2], segmentN[3], segmentN[4], segmentN[5], segmentN[6]);
- // 当 path 不连续时,segmentL 可能为空,为空时需要作为 0 处理
- tempLength += segmentL || 0;
- segmentT[1] = tempLength / totalLength;
- tCache.push(segmentT);
- }
- });
- this.set('tCache', tCache);
- };
- /**
- * Get start tangent vector
- * @return {Array}
- */
- Path.prototype.getStartTangent = function () {
- var segments = this.getSegments();
- var result;
- if (segments.length > 1) {
- var startPoint = segments[0].currentPoint;
- var endPoint = segments[1].currentPoint;
- var tangent = segments[1].startTangent;
- result = [];
- if (tangent) {
- result.push([startPoint[0] - tangent[0], startPoint[1] - tangent[1]]);
- result.push([startPoint[0], startPoint[1]]);
- }
- else {
- result.push([endPoint[0], endPoint[1]]);
- result.push([startPoint[0], startPoint[1]]);
- }
- }
- return result;
- };
- /**
- * Get end tangent vector
- * @return {Array}
- */
- Path.prototype.getEndTangent = function () {
- var segments = this.getSegments();
- var length = segments.length;
- var result;
- if (length > 1) {
- var startPoint = segments[length - 2].currentPoint;
- var endPoint = segments[length - 1].currentPoint;
- var tangent = segments[length - 1].endTangent;
- result = [];
- if (tangent) {
- result.push([endPoint[0] - tangent[0], endPoint[1] - tangent[1]]);
- result.push([endPoint[0], endPoint[1]]);
- }
- else {
- result.push([startPoint[0], startPoint[1]]);
- result.push([endPoint[0], endPoint[1]]);
- }
- }
- return result;
- };
- return Path;
- }(base_1.default));
- exports.default = Path;
- /***/ }),
- /***/ "./src/shape/polygon.ts":
- /*!******************************!*\
- !*** ./src/shape/polygon.ts ***!
- \******************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview 多边形
- * @author dxq613@gmail.com
- */
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
- var polyline_1 = __webpack_require__(/*! ../util/in-stroke/polyline */ "./src/util/in-stroke/polyline.ts");
- var polygon_1 = __webpack_require__(/*! ../util/in-path/polygon */ "./src/util/in-path/polygon.ts");
- var Polygon = /** @class */ (function (_super) {
- tslib_1.__extends(Polygon, _super);
- function Polygon() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Polygon.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
- var points = this.attr().points;
- var isHit = false;
- if (isStroke) {
- isHit = polyline_1.default(points, lineWidth, x, y, true);
- }
- if (!isHit && isFill) {
- isHit = polygon_1.default(points, x, y); // isPointInPath(shape, x, y);
- }
- return isHit;
- };
- Polygon.prototype.createPath = function (context) {
- var attrs = this.attr();
- var points = attrs.points;
- if (points.length < 2) {
- return;
- }
- context.beginPath();
- for (var i = 0; i < points.length; i++) {
- var point = points[i];
- if (i === 0) {
- context.moveTo(point[0], point[1]);
- }
- else {
- context.lineTo(point[0], point[1]);
- }
- }
- context.closePath();
- };
- return Polygon;
- }(base_1.default));
- exports.default = Polygon;
- /***/ }),
- /***/ "./src/shape/polyline.ts":
- /*!*******************************!*\
- !*** ./src/shape/polyline.ts ***!
- \*******************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- var line_1 = __webpack_require__(/*! @antv/g-math/lib/line */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js");
- var polyline_1 = __webpack_require__(/*! @antv/g-math/lib/polyline */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/polyline.js");
- var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
- var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
- var polyline_2 = __webpack_require__(/*! ../util/in-stroke/polyline */ "./src/util/in-stroke/polyline.ts");
- var ArrowUtil = __webpack_require__(/*! ../util/arrow */ "./src/util/arrow.ts");
- var PolyLine = /** @class */ (function (_super) {
- tslib_1.__extends(PolyLine, _super);
- function PolyLine() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- PolyLine.prototype.getDefaultAttrs = function () {
- var attrs = _super.prototype.getDefaultAttrs.call(this);
- return tslib_1.__assign(tslib_1.__assign({}, attrs), { startArrow: false, endArrow: false });
- };
- PolyLine.prototype.initAttrs = function (attrs) {
- this.setArrow();
- };
- // 更新属性时,检测是否更改了 points
- PolyLine.prototype.onAttrChange = function (name, value, originValue) {
- _super.prototype.onAttrChange.call(this, name, value, originValue);
- this.setArrow();
- if (['points'].indexOf(name) !== -1) {
- this._resetCache();
- }
- };
- PolyLine.prototype._resetCache = function () {
- this.set('totalLength', null);
- this.set('tCache', null);
- };
- PolyLine.prototype.setArrow = function () {
- var attrs = this.attr();
- var _a = this.attrs, points = _a.points, startArrow = _a.startArrow, endArrow = _a.endArrow;
- var length = points.length;
- var x1 = points[0][0];
- var y1 = points[0][1];
- var x2 = points[length - 1][0];
- var y2 = points[length - 1][1];
- if (startArrow) {
- ArrowUtil.addStartArrow(this, attrs, points[1][0], points[1][1], x1, y1);
- }
- if (endArrow) {
- ArrowUtil.addEndArrow(this, attrs, points[length - 2][0], points[length - 2][1], x2, y2);
- }
- };
- // 不允许 fill
- PolyLine.prototype.isFill = function () {
- return false;
- };
- PolyLine.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
- // 没有设置 stroke 不能被拾取, 没有线宽不能被拾取
- if (!isStroke || !lineWidth) {
- return false;
- }
- var points = this.attr().points;
- return polyline_2.default(points, lineWidth, x, y, false);
- };
- // 始终填充
- PolyLine.prototype.isStroke = function () {
- return true;
- };
- PolyLine.prototype.createPath = function (context) {
- var _a = this.attr(), points = _a.points, startArrow = _a.startArrow, endArrow = _a.endArrow;
- var length = points.length;
- if (points.length < 2) {
- return;
- }
- var x1 = points[0][0];
- var y1 = points[0][1];
- var x2 = points[length - 1][0];
- var y2 = points[length - 1][1];
- // 如果定义了箭头,并且是自定义箭头,线条相应缩进
- if (startArrow && startArrow.d) {
- var distance = ArrowUtil.getShortenOffset(x1, y1, points[1][0], points[1][1], startArrow.d);
- x1 += distance.dx;
- y1 += distance.dy;
- }
- if (endArrow && endArrow.d) {
- var distance = ArrowUtil.getShortenOffset(points[length - 2][0], points[length - 2][1], x2, y2, endArrow.d);
- x2 -= distance.dx;
- y2 -= distance.dy;
- }
- context.beginPath();
- context.moveTo(x1, y1);
- for (var i = 0; i < length - 1; i++) {
- var point = points[i];
- context.lineTo(point[0], point[1]);
- }
- context.lineTo(x2, y2);
- };
- PolyLine.prototype.afterDrawPath = function (context) {
- var startArrowShape = this.get('startArrowShape');
- var endArrowShape = this.get('endArrowShape');
- if (startArrowShape) {
- startArrowShape.draw(context);
- }
- if (endArrowShape) {
- endArrowShape.draw(context);
- }
- };
- /**
- * Get length of polyline
- * @return {number} length
- */
- PolyLine.prototype.getTotalLength = function () {
- var points = this.attr().points;
- // get totalLength from cache
- var totalLength = this.get('totalLength');
- if (!util_1.isNil(totalLength)) {
- return totalLength;
- }
- this.set('totalLength', polyline_1.default.length(points));
- return this.get('totalLength');
- };
- /**
- * Get point according to ratio
- * @param {number} ratio
- * @return {Point} point
- */
- PolyLine.prototype.getPoint = function (ratio) {
- var points = this.attr().points;
- // get tCache from cache
- var tCache = this.get('tCache');
- if (!tCache) {
- this._setTcache();
- tCache = this.get('tCache');
- }
- var subt;
- var index;
- util_1.each(tCache, function (v, i) {
- if (ratio >= v[0] && ratio <= v[1]) {
- subt = (ratio - v[0]) / (v[1] - v[0]);
- index = i;
- }
- });
- return line_1.default.pointAt(points[index][0], points[index][1], points[index + 1][0], points[index + 1][1], subt);
- };
- PolyLine.prototype._setTcache = function () {
- var points = this.attr().points;
- if (!points || points.length === 0) {
- return;
- }
- var totalLength = this.getTotalLength();
- if (totalLength <= 0) {
- return;
- }
- var tempLength = 0;
- var tCache = [];
- var segmentT;
- var segmentL;
- util_1.each(points, function (p, i) {
- if (points[i + 1]) {
- segmentT = [];
- segmentT[0] = tempLength / totalLength;
- segmentL = line_1.default.length(p[0], p[1], points[i + 1][0], points[i + 1][1]);
- tempLength += segmentL;
- segmentT[1] = tempLength / totalLength;
- tCache.push(segmentT);
- }
- });
- this.set('tCache', tCache);
- };
- /**
- * Get start tangent vector
- * @return {Array}
- */
- PolyLine.prototype.getStartTangent = function () {
- var points = this.attr().points;
- var result = [];
- result.push([points[1][0], points[1][1]]);
- result.push([points[0][0], points[0][1]]);
- return result;
- };
- /**
- * Get end tangent vector
- * @return {Array}
- */
- PolyLine.prototype.getEndTangent = function () {
- var points = this.attr().points;
- var l = points.length - 1;
- var result = [];
- result.push([points[l - 1][0], points[l - 1][1]]);
- result.push([points[l][0], points[l][1]]);
- return result;
- };
- return PolyLine;
- }(base_1.default));
- exports.default = PolyLine;
- /***/ }),
- /***/ "./src/shape/rect.ts":
- /*!***************************!*\
- !*** ./src/shape/rect.ts ***!
- \***************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview 矩形
- * @author dxq613@gmail.com
- */
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
- var parse_1 = __webpack_require__(/*! ../util/parse */ "./src/util/parse.ts");
- var util_1 = __webpack_require__(/*! ../util/util */ "./src/util/util.ts");
- var rect_1 = __webpack_require__(/*! ../util/in-stroke/rect */ "./src/util/in-stroke/rect.ts");
- var rect_radius_1 = __webpack_require__(/*! ../util/in-stroke/rect-radius */ "./src/util/in-stroke/rect-radius.ts");
- var point_in_path_1 = __webpack_require__(/*! ../util/in-path/point-in-path */ "./src/util/in-path/point-in-path.ts");
- var Rect = /** @class */ (function (_super) {
- tslib_1.__extends(Rect, _super);
- function Rect() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Rect.prototype.getDefaultAttrs = function () {
- var attrs = _super.prototype.getDefaultAttrs.call(this);
- return tslib_1.__assign(tslib_1.__assign({}, attrs), { x: 0, y: 0, width: 0, height: 0, radius: 0 });
- };
- Rect.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
- var attrs = this.attr();
- var minX = attrs.x;
- var minY = attrs.y;
- var width = attrs.width;
- var height = attrs.height;
- var radius = attrs.radius;
- // 无圆角时的策略
- if (!radius) {
- var halfWidth = lineWidth / 2;
- // 同时填充和带有边框
- if (isFill && isStroke) {
- return util_1.inBox(minX - halfWidth, minY - halfWidth, width + halfWidth, height + halfWidth, x, y);
- }
- // 仅填充
- if (isFill) {
- return util_1.inBox(minX, minY, width, height, x, y);
- }
- if (isStroke) {
- return rect_1.default(minX, minY, width, height, lineWidth, x, y);
- }
- }
- else {
- var isHit = false;
- if (isStroke) {
- isHit = rect_radius_1.default(minX, minY, width, height, radius, lineWidth, x, y);
- }
- // 仅填充时带有圆角的矩形直接通过图形拾取
- // 以后可以改成纯数学的近似拾取,将圆弧切割成多边形
- if (!isHit && isFill) {
- isHit = point_in_path_1.default(this, x, y);
- }
- return isHit;
- }
- };
- Rect.prototype.createPath = function (context) {
- var attrs = this.attr();
- var x = attrs.x;
- var y = attrs.y;
- var width = attrs.width;
- var height = attrs.height;
- var radius = attrs.radius;
- context.beginPath();
- if (radius === 0) {
- // 改成原生的rect方法
- context.rect(x, y, width, height);
- }
- else {
- var _a = parse_1.parseRadius(radius), r1 = _a[0], r2 = _a[1], r3 = _a[2], r4 = _a[3];
- context.moveTo(x + r1, y);
- context.lineTo(x + width - r2, y);
- r2 !== 0 && context.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);
- context.lineTo(x + width, y + height - r3);
- r3 !== 0 && context.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);
- context.lineTo(x + r4, y + height);
- r4 !== 0 && context.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);
- context.lineTo(x, y + r1);
- r1 !== 0 && context.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);
- context.closePath();
- }
- };
- return Rect;
- }(base_1.default));
- exports.default = Rect;
- /***/ }),
- /***/ "./src/shape/text.ts":
- /*!***************************!*\
- !*** ./src/shape/text.ts ***!
- \***************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview 文本
- * @author dxq613@gmail.com
- */
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
- var util_1 = __webpack_require__(/*! ../util/util */ "./src/util/util.ts");
- var text_1 = __webpack_require__(/*! @antv/g-base/lib/util/text */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/text.js");
- var Text = /** @class */ (function (_super) {
- tslib_1.__extends(Text, _super);
- function Text() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- // 默认文本属性
- Text.prototype.getDefaultAttrs = function () {
- var attrs = _super.prototype.getDefaultAttrs.call(this);
- return tslib_1.__assign(tslib_1.__assign({}, attrs), { x: 0, y: 0, text: null, fontSize: 12, fontFamily: 'sans-serif', fontStyle: 'normal', fontWeight: 'normal', fontVariant: 'normal', textAlign: 'start', textBaseline: 'bottom' });
- };
- // 仅仅使用包围盒检测来进行拾取
- Text.prototype.isOnlyHitBox = function () {
- return true;
- };
- // 初始化时组合 font,同时判断 text 是否换行
- Text.prototype.initAttrs = function (attrs) {
- this._assembleFont();
- if (attrs.text) {
- this._setText(attrs.text);
- }
- };
- // 组装字体
- Text.prototype._assembleFont = function () {
- var attrs = this.attrs;
- attrs.font = text_1.assembleFont(attrs);
- };
- // 如果文本换行,则缓存数组
- Text.prototype._setText = function (text) {
- var textArr = null;
- if (util_1.isString(text) && text.indexOf('\n') !== -1) {
- textArr = text.split('\n');
- }
- this.set('textArr', textArr);
- };
- // 更新属性时,检测是否更改了 font、text
- Text.prototype.onAttrChange = function (name, value, originValue) {
- _super.prototype.onAttrChange.call(this, name, value, originValue);
- if (name.startsWith('font')) {
- this._assembleFont();
- }
- if (name === 'text') {
- this._setText(value);
- }
- };
- // 这个方法在 text 时没有可以做的事情,如果要支持文字背景时可以考虑
- // createPath(context) {
- // }
- // 如果文本多行,需要获取文本间距
- Text.prototype._getSpaceingY = function () {
- var attrs = this.attrs;
- var lineHeight = attrs.lineHeight;
- var fontSize = attrs.fontSize * 1;
- return lineHeight ? lineHeight - fontSize : fontSize * 0.14;
- };
- // 绘制文本,考虑多行的场景
- Text.prototype._drawTextArr = function (context, textArr, isFill) {
- var attrs = this.attrs;
- var textBaseline = attrs.textBaseline;
- var x = attrs.x;
- var y = attrs.y;
- var fontSize = attrs.fontSize * 1;
- var spaceingY = this._getSpaceingY();
- var height = text_1.getTextHeight(attrs.text, attrs.fontSize, attrs.lineHeight);
- var subY;
- util_1.each(textArr, function (subText, index) {
- subY = y + index * (spaceingY + fontSize) - height + fontSize; // bottom;
- if (textBaseline === 'middle')
- subY += height - fontSize - (height - fontSize) / 2;
- if (textBaseline === 'top')
- subY += height - fontSize;
- if (isFill) {
- context.fillText(subText, x, subY);
- }
- else {
- context.strokeText(subText, x, subY);
- }
- });
- };
- // 绘制文本,同时考虑填充和绘制边框
- Text.prototype._drawText = function (context, isFill) {
- var attrs = this.attr();
- var x = attrs.x;
- var y = attrs.y;
- var textArr = this.get('textArr');
- if (textArr) {
- this._drawTextArr(context, textArr, isFill);
- }
- else {
- var text = attrs.text;
- if (isFill) {
- context.fillText(text, x, y);
- }
- else {
- context.strokeText(text, x, y);
- }
- }
- };
- // 复写绘制和填充的逻辑:对于文本,应该先绘制边框,再进行填充
- Text.prototype.strokeAndFill = function (context) {
- var _a = this.attrs, lineWidth = _a.lineWidth, opacity = _a.opacity, strokeOpacity = _a.strokeOpacity, fillOpacity = _a.fillOpacity;
- if (this.isStroke()) {
- if (lineWidth > 0) {
- if (!util_1.isNil(strokeOpacity) && strokeOpacity !== 1) {
- context.globalAlpha = opacity;
- }
- this.stroke(context);
- }
- }
- if (this.isFill()) {
- if (!util_1.isNil(fillOpacity) && fillOpacity !== 1) {
- context.globalAlpha = fillOpacity;
- this.fill(context);
- context.globalAlpha = opacity;
- }
- else {
- this.fill(context);
- }
- }
- this.afterDrawPath(context);
- };
- // 复写填充逻辑
- Text.prototype.fill = function (context) {
- this._drawText(context, true);
- };
- // 复写绘制边框的逻辑
- Text.prototype.stroke = function (context) {
- this._drawText(context, false);
- };
- return Text;
- }(base_1.default));
- exports.default = Text;
- /***/ }),
- /***/ "./src/types.ts":
- /*!**********************!*\
- !*** ./src/types.ts ***!
- \**********************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- // 导出 g-base 中的 types
- tslib_1.__exportStar(__webpack_require__(/*! @antv/g-base/lib/types */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/types.js"), exports);
- /***/ }),
- /***/ "./src/util/arc-params.ts":
- /*!********************************!*\
- !*** ./src/util/arc-params.ts ***!
- \********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var util_1 = __webpack_require__(/*! ./util */ "./src/util/util.ts");
- // 向量长度
- function vMag(v) {
- return Math.sqrt(v[0] * v[0] + v[1] * v[1]);
- }
- // u.v/|u||v|,计算夹角的余弦值
- function vRatio(u, v) {
- // 当存在一个向量的长度为 0 时,夹角也为 0,即夹角的余弦值为 1
- return vMag(u) * vMag(v) ? (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)) : 1;
- }
- // 向量角度
- function vAngle(u, v) {
- return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));
- }
- // A 0:rx 1:ry 2:x-axis-rotation 3:large-arc-flag 4:sweep-flag 5: x 6: y
- function getArcParams(startPoint, params) {
- var rx = params[1];
- var ry = params[2];
- var xRotation = util_1.mod(util_1.toRadian(params[3]), Math.PI * 2);
- var arcFlag = params[4];
- var sweepFlag = params[5];
- // 弧形起点坐标
- var x1 = startPoint[0];
- var y1 = startPoint[1];
- // 弧形终点坐标
- var x2 = params[6];
- var y2 = params[7];
- var xp = (Math.cos(xRotation) * (x1 - x2)) / 2.0 + (Math.sin(xRotation) * (y1 - y2)) / 2.0;
- var yp = (-1 * Math.sin(xRotation) * (x1 - x2)) / 2.0 + (Math.cos(xRotation) * (y1 - y2)) / 2.0;
- var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);
- if (lambda > 1) {
- rx *= Math.sqrt(lambda);
- ry *= Math.sqrt(lambda);
- }
- var diff = rx * rx * (yp * yp) + ry * ry * (xp * xp);
- var f = diff ? Math.sqrt((rx * rx * (ry * ry) - diff) / diff) : 1;
- if (arcFlag === sweepFlag) {
- f *= -1;
- }
- if (isNaN(f)) {
- f = 0;
- }
- // 旋转前的起点坐标,且当长半轴和短半轴的长度为 0 时,坐标按 (0, 0) 处理
- var cxp = ry ? (f * rx * yp) / ry : 0;
- var cyp = rx ? (f * -ry * xp) / rx : 0;
- // 椭圆圆心坐标
- var cx = (x1 + x2) / 2.0 + Math.cos(xRotation) * cxp - Math.sin(xRotation) * cyp;
- var cy = (y1 + y2) / 2.0 + Math.sin(xRotation) * cxp + Math.cos(xRotation) * cyp;
- // 起始点的单位向量
- var u = [(xp - cxp) / rx, (yp - cyp) / ry];
- // 终止点的单位向量
- var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];
- // 计算起始点和圆心的连线,与 x 轴正方向的夹角
- var theta = vAngle([1, 0], u);
- // 计算圆弧起始点和终止点与椭圆圆心连线的夹角
- var dTheta = vAngle(u, v);
- if (vRatio(u, v) <= -1) {
- dTheta = Math.PI;
- }
- if (vRatio(u, v) >= 1) {
- dTheta = 0;
- }
- if (sweepFlag === 0 && dTheta > 0) {
- dTheta = dTheta - 2 * Math.PI;
- }
- if (sweepFlag === 1 && dTheta < 0) {
- dTheta = dTheta + 2 * Math.PI;
- }
- return {
- cx: cx,
- cy: cy,
- // 弧形的起点和终点相同时,长轴和短轴的长度按 0 处理
- rx: util_1.isSamePoint(startPoint, [x2, y2]) ? 0 : rx,
- ry: util_1.isSamePoint(startPoint, [x2, y2]) ? 0 : ry,
- startAngle: theta,
- endAngle: theta + dTheta,
- xRotation: xRotation,
- arcFlag: arcFlag,
- sweepFlag: sweepFlag,
- };
- }
- exports.default = getArcParams;
- /***/ }),
- /***/ "./src/util/arrow.ts":
- /*!***************************!*\
- !*** ./src/util/arrow.ts ***!
- \***************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.addEndArrow = exports.addStartArrow = exports.getShortenOffset = void 0;
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- var shape_1 = __webpack_require__(/*! ../shape */ "./src/shape/index.ts");
- var sin = Math.sin, cos = Math.cos, atan2 = Math.atan2, PI = Math.PI;
- function _addDefaultArrow(shape, attrs, x1, y1, x2, y2, isStart) {
- var stroke = attrs.stroke, lineWidth = attrs.lineWidth;
- var x = x1 - x2;
- var y = y1 - y2;
- var rad = atan2(y, x);
- var arrowShape = new shape_1.Path({
- type: 'path',
- canvas: shape.get('canvas'),
- isArrowShape: true,
- attrs: {
- // 默认箭头的边长为 10,夹角为 60 度
- path: "M" + 10 * cos(PI / 6) + "," + 10 * sin(PI / 6) + " L0,0 L" + 10 * cos(PI / 6) + ",-" + 10 * sin(PI / 6),
- // 使用 shape stroke 值
- stroke: stroke,
- lineWidth: lineWidth,
- },
- });
- arrowShape.translate(x2, y2);
- arrowShape.rotateAtPoint(x2, y2, rad);
- shape.set(isStart ? 'startArrowShape' : 'endArrowShape', arrowShape);
- }
- /**
- * 箭头 path 的设置要求
- * 1. 箭头顶点坐标需要为 (0, 0)
- * 2. 箭头夹角的中心分割线需要与 X 轴正方向对齐
- */
- function _addCustomizedArrow(shape, attrs, x1, y1, x2, y2, isStart) {
- var startArrow = attrs.startArrow, endArrow = attrs.endArrow, stroke = attrs.stroke, lineWidth = attrs.lineWidth;
- var arrowAttrs = isStart ? startArrow : endArrow;
- var d = arrowAttrs.d, arrowFill = arrowAttrs.fill, arrowStroke = arrowAttrs.stroke, arrowLineWidth = arrowAttrs.lineWidth, restAttrs = tslib_1.__rest(arrowAttrs, ["d", "fill", "stroke", "lineWidth"]);
- var x = x1 - x2;
- var y = y1 - y2;
- var rad = atan2(y, x);
- if (d) {
- x2 = x2 - cos(rad) * d;
- y2 = y2 - sin(rad) * d;
- }
- var arrowShape = new shape_1.Path({
- type: 'path',
- canvas: shape.get('canvas'),
- isArrowShape: true,
- attrs: tslib_1.__assign(tslib_1.__assign({}, restAttrs), {
- // 支持单独设置箭头的 stroke 和 lineWidth,若为空则使用 shape 的值
- stroke: arrowStroke || stroke, lineWidth: arrowLineWidth || lineWidth,
- // 箭头是否填充需要手动设置,不会继承自 shape 的值
- fill: arrowFill }),
- });
- arrowShape.translate(x2, y2);
- arrowShape.rotateAtPoint(x2, y2, rad);
- shape.set(isStart ? 'startArrowShape' : 'endArrowShape', arrowShape);
- }
- /**
- * 如果自定义箭头并且有 d 需要做偏移,如果直接画,线条会超出箭头尖端,因此需要根据箭头偏移 d, 返回线需要缩短的距离
- * |----------------
- * |<|--------------
- * |
- * @param {number} x1 起始点 x
- * @param {number} y1 起始点 y
- * @param {number} x2 箭头作用点 x
- * @param {number} y2 箭头作用点 y
- * @param {number} d 箭头沿线条方向的偏移距离
- * @return {{dx: number, dy: number}} 返回线条偏移距离
- */
- function getShortenOffset(x1, y1, x2, y2, d) {
- var rad = atan2(y2 - y1, x2 - x1);
- return {
- dx: cos(rad) * d,
- dy: sin(rad) * d,
- };
- }
- exports.getShortenOffset = getShortenOffset;
- /**
- * 绘制起始箭头
- * @param {IShape} shape 图形
- * @param {ShapeAttrs} attrs shape 的绘图属性
- * @param {number} x1 起始点 x
- * @param {number} y1 起始点 y
- * @param {number} x2 箭头作用点 x
- * @param {number} y2 箭头作用点 y
- */
- function addStartArrow(shape, attrs, x1, y1, x2, y2) {
- if (typeof attrs.startArrow === 'object') {
- _addCustomizedArrow(shape, attrs, x1, y1, x2, y2, true);
- }
- else if (attrs.startArrow) {
- _addDefaultArrow(shape, attrs, x1, y1, x2, y2, true);
- }
- else {
- shape.set('startArrowShape', null);
- }
- }
- exports.addStartArrow = addStartArrow;
- /**
- * 绘制结束箭头
- * @param {IShape} shape 图形
- * @param {ShapeAttrs} attrs shape 的绘图属性
- * @param {number} x1 起始点 x
- * @param {number} y1 起始点 y
- * @param {number} x2 箭头作用点 x
- * @param {number} y2 箭头作用点 y
- */
- function addEndArrow(shape, attrs, x1, y1, x2, y2) {
- if (typeof attrs.endArrow === 'object') {
- _addCustomizedArrow(shape, attrs, x1, y1, x2, y2, false);
- }
- else if (attrs.endArrow) {
- _addDefaultArrow(shape, attrs, x1, y1, x2, y2, false);
- }
- else {
- shape.set('startArrowShape', null);
- }
- }
- exports.addEndArrow = addEndArrow;
- /***/ }),
- /***/ "./src/util/draw.ts":
- /*!**************************!*\
- !*** ./src/util/draw.ts ***!
- \**************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.mergeView = exports.getMergedRegion = exports.getRefreshRegion = exports.refreshElement = exports.drawPath = exports.clearChanged = exports.checkChildrenRefresh = exports.checkRefresh = exports.drawChildren = exports.applyAttrsToContext = void 0;
- var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
- var parse_1 = __webpack_require__(/*! ./parse */ "./src/util/parse.ts");
- var arc_params_1 = __webpack_require__(/*! ./arc-params */ "./src/util/arc-params.ts");
- var util_2 = __webpack_require__(/*! ./util */ "./src/util/util.ts");
- var ArrowUtil = __webpack_require__(/*! ../util/arrow */ "./src/util/arrow.ts");
- var SHAPE_ATTRS_MAP = {
- fill: 'fillStyle',
- stroke: 'strokeStyle',
- opacity: 'globalAlpha',
- };
- function applyAttrsToContext(context, element) {
- var attrs = element.attr();
- for (var k in attrs) {
- var v = attrs[k];
- // 转换一下不与 canvas 兼容的属性名
- var name = SHAPE_ATTRS_MAP[k] ? SHAPE_ATTRS_MAP[k] : k;
- if (name === 'matrix' && v) {
- // 设置矩阵
- context.transform(v[0], v[1], v[3], v[4], v[6], v[7]);
- }
- else if (name === 'lineDash' && context.setLineDash) {
- // 设置虚线,只支持数组形式,非数组形式不做任何操作
- util_1.isArray(v) && context.setLineDash(v);
- }
- else {
- if (name === 'strokeStyle' || name === 'fillStyle') {
- // 如果存在渐变、pattern 这个开销有些大
- // 可以考虑缓存机制,通过 hasUpdate 来避免一些运算
- v = parse_1.parseStyle(context, element, v);
- }
- else if (name === 'globalAlpha') {
- // opacity 效果可以叠加,子元素的 opacity 需要与父元素 opacity 相乘
- v = v * context.globalAlpha;
- }
- context[name] = v;
- }
- }
- }
- exports.applyAttrsToContext = applyAttrsToContext;
- function drawChildren(context, children, region) {
- for (var i = 0; i < children.length; i++) {
- var child = children[i];
- if (child.cfg.visible) {
- child.draw(context, region);
- }
- else {
- child.skipDraw();
- }
- }
- }
- exports.drawChildren = drawChildren;
- // 这个地方的逻辑比较复杂,简单画了一张图:https://www.yuque.com/antv/ou292n/pcgt5g#OW1QE
- function checkRefresh(canvas, children, region) {
- var refreshElements = canvas.get('refreshElements');
- // 先遍历需要刷新的元素,将这些元素的父元素也设置 refresh
- util_1.each(refreshElements, function (el) {
- if (el !== canvas) {
- var parent = el.cfg.parent;
- while (parent && parent !== canvas && !parent.cfg.refresh) {
- parent.cfg.refresh = true;
- parent = parent.cfg.parent;
- }
- }
- });
- if (refreshElements[0] === canvas) {
- setChildrenRefresh(children, region);
- }
- else {
- // 检查所有子元素是否可以刷新
- checkChildrenRefresh(children, region);
- }
- }
- exports.checkRefresh = checkRefresh;
- // 检查所有的子元素是否应该更新
- function checkChildrenRefresh(children, region) {
- for (var i = 0; i < children.length; i++) {
- var child = children[i];
- if (child.cfg.visible) {
- // 如果当前图形/分组 refresh = true,说明其子节点存在 changed
- if (child.cfg.refresh) {
- if (child.isGroup()) {
- checkChildrenRefresh(child.cfg.children, region);
- }
- }
- else if (child.cfg.hasChanged) {
- // 如果节点发生了 change,则需要级联设置子元素的 refresh
- child.cfg.refresh = true;
- if (child.isGroup()) {
- setChildrenRefresh(child.cfg.children, region);
- }
- }
- else {
- // 这个分支说明此次局部刷新,所有的节点和父元素没有发生变化,仅需要检查包围盒(缓存)是否相交即可
- child.cfg.refresh = checkElementRefresh(child, region);
- }
- }
- }
- }
- exports.checkChildrenRefresh = checkChildrenRefresh;
- // 由于对改变的图形放入 refreshElements 时做了优化,判定父元素 changed 时不加入
- // 那么有可能会出现 elements 都为空,所以最终 group
- function clearChanged(elements) {
- for (var i = 0; i < elements.length; i++) {
- var el = elements[i];
- el.cfg.hasChanged = false;
- // 级联清理
- if (el.isGroup()) {
- clearChanged(el.cfg.children);
- }
- }
- }
- exports.clearChanged = clearChanged;
- // 当某个父元素发生改变时,调用这个方法级联设置 refresh
- function setChildrenRefresh(children, region) {
- for (var i = 0; i < children.length; i++) {
- var child = children[i];
- // let refresh = true;
- // 获取缓存的 bbox,如果这个 bbox 还存在则说明父元素不是矩阵发生了改变
- // const bbox = child.cfg.canvasBBox;
- // if (bbox) {
- // // 如果这时候
- // refresh = intersectRect(bbox, region);
- // }
- child.cfg.refresh = true;
- // 如果需要刷新当前节点,所有的子元素设置 refresh
- if (child.isGroup()) {
- setChildrenRefresh(child.get('children'), region);
- }
- }
- }
- function checkElementRefresh(shape, region) {
- var bbox = shape.cfg.cacheCanvasBBox;
- var isAllow = shape.cfg.isInView && bbox && util_2.intersectRect(bbox, region);
- return isAllow;
- }
- // 绘制 path
- function drawPath(shape, context, attrs, arcParamsCache) {
- var path = attrs.path, startArrow = attrs.startArrow, endArrow = attrs.endArrow;
- var currentPoint = [0, 0]; // 当前图形
- var startMovePoint = [0, 0]; // 开始 M 的点,可能会有多个
- var distance = {
- dx: 0,
- dy: 0,
- };
- context.beginPath();
- for (var i = 0; i < path.length; i++) {
- var params = path[i];
- var command = params[0];
- if (i === 0 && startArrow && startArrow.d) {
- var tangent = shape.getStartTangent();
- distance = ArrowUtil.getShortenOffset(tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1], startArrow.d);
- }
- else if (i === path.length - 2 && path[i + 1][0] === 'Z' && endArrow && endArrow.d) {
- // 为了防止结尾为 Z 的 segment 缩短不起效,需要取最后两个 segment 特殊处理
- var lastPath = path[i + 1];
- if (lastPath[0] === 'Z') {
- var tangent = shape.getEndTangent();
- distance = ArrowUtil.getShortenOffset(tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1], endArrow.d);
- }
- }
- else if (i === path.length - 1 && endArrow && endArrow.d) {
- if (path[0] !== 'Z') {
- var tangent = shape.getEndTangent();
- distance = ArrowUtil.getShortenOffset(tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1], endArrow.d);
- }
- }
- var dx = distance.dx, dy = distance.dy;
- // V,H,S,T 都在前面被转换成标准形式
- switch (command) {
- case 'M':
- context.moveTo(params[1] - dx, params[2] - dy);
- startMovePoint = [params[1], params[2]];
- break;
- case 'L':
- context.lineTo(params[1] - dx, params[2] - dy);
- break;
- case 'Q':
- context.quadraticCurveTo(params[1], params[2], params[3] - dx, params[4] - dy);
- break;
- case 'C':
- context.bezierCurveTo(params[1], params[2], params[3], params[4], params[5] - dx, params[6] - dy);
- break;
- case 'A': {
- var arcParams = void 0;
- // 为了加速绘制,可以提供参数的缓存,各个图形自己缓存
- if (arcParamsCache) {
- arcParams = arcParamsCache[i];
- if (!arcParams) {
- arcParams = arc_params_1.default(currentPoint, params);
- arcParamsCache[i] = arcParams;
- }
- }
- else {
- arcParams = arc_params_1.default(currentPoint, params);
- }
- var cx = arcParams.cx, cy = arcParams.cy, rx = arcParams.rx, ry = arcParams.ry, startAngle = arcParams.startAngle, endAngle = arcParams.endAngle, xRotation = arcParams.xRotation, sweepFlag = arcParams.sweepFlag;
- // 直接使用椭圆的 api
- if (context.ellipse) {
- context.ellipse(cx, cy, rx, ry, xRotation, startAngle, endAngle, 1 - sweepFlag);
- }
- else {
- var r = rx > ry ? rx : ry;
- var scaleX = rx > ry ? 1 : rx / ry;
- var scaleY = rx > ry ? ry / rx : 1;
- context.translate(cx, cy);
- context.rotate(xRotation);
- context.scale(scaleX, scaleY);
- context.arc(0, 0, r, startAngle, endAngle, 1 - sweepFlag);
- context.scale(1 / scaleX, 1 / scaleY);
- context.rotate(-xRotation);
- context.translate(-cx, -cy);
- }
- break;
- }
- case 'Z':
- context.closePath();
- break;
- default:
- break;
- }
- // 有了 Z 后,当前节点从开始 M 的点开始
- if (command === 'Z') {
- currentPoint = startMovePoint;
- }
- else {
- var len = params.length;
- currentPoint = [params[len - 2], params[len - 1]];
- }
- }
- }
- exports.drawPath = drawPath;
- // 刷新图形元素(Shape 或者 Group)
- function refreshElement(element, changeType) {
- var canvas = element.get('canvas');
- // 只有存在于 canvas 上时生效
- if (canvas) {
- if (changeType === 'remove') {
- // 一旦 remove,则无法在 element 上拿到包围盒
- // destroy 后所有属性都拿不到,所以需要暂存一下
- // 这是一段 hack 的代码
- element._cacheCanvasBBox = element.get('cacheCanvasBBox');
- }
- // 防止反复刷新
- if (!element.get('hasChanged')) {
- // 但是始终要标记为 hasChanged,便于后面进行局部渲染
- element.set('hasChanged', true);
- // 本来只有局部渲染模式下,才需要记录更新的元素队列
- // if (canvas.get('localRefresh')) {
- // canvas.refreshElement(element, changeType, canvas);
- // }
- // 但对于 https://github.com/antvis/g/issues/422 的场景,全局渲染的模式下也需要记录更新的元素队列
- // 如果当前元素的父元素发生了改变,可以不放入队列,这句话大概能够提升 15% 的初次渲染性能
- if (!(element.cfg.parent && element.cfg.parent.get('hasChanged'))) {
- canvas.refreshElement(element, changeType, canvas);
- if (canvas.get('autoDraw')) {
- canvas.draw();
- }
- }
- }
- }
- }
- exports.refreshElement = refreshElement;
- function getRefreshRegion(element) {
- var region;
- if (!element.destroyed) {
- var cacheBox = element.get('cacheCanvasBBox');
- var validCache = cacheBox && !!(cacheBox.width && cacheBox.height);
- var bbox = element.getCanvasBBox();
- var validBBox = bbox && !!(bbox.width && bbox.height);
- // 是否是有效 bbox 判定,一些 NaN 或者 宽高为 0 的情况过滤掉
- if (validCache && validBBox) {
- region = util_2.mergeRegion(cacheBox, bbox);
- }
- else if (validCache) {
- region = cacheBox;
- }
- else if (validBBox) {
- region = bbox;
- }
- }
- else {
- // 因为元素已经销毁所以无法获取到缓存的包围盒
- region = element['_cacheCanvasBBox'];
- }
- return region;
- }
- exports.getRefreshRegion = getRefreshRegion;
- function getMergedRegion(elements) {
- if (!elements.length) {
- return null;
- }
- var minXArr = [];
- var minYArr = [];
- var maxXArr = [];
- var maxYArr = [];
- util_1.each(elements, function (el) {
- var region = getRefreshRegion(el);
- if (region) {
- minXArr.push(region.minX);
- minYArr.push(region.minY);
- maxXArr.push(region.maxX);
- maxYArr.push(region.maxY);
- }
- });
- return {
- minX: Math.min.apply(null, minXArr),
- minY: Math.min.apply(null, minYArr),
- maxX: Math.max.apply(null, maxXArr),
- maxY: Math.max.apply(null, maxYArr),
- };
- }
- exports.getMergedRegion = getMergedRegion;
- function mergeView(region, viewRegion) {
- if (!region || !viewRegion) {
- return null;
- }
- // 不相交,则直接返回 null
- if (!util_2.intersectRect(region, viewRegion)) {
- return null;
- }
- return {
- minX: Math.max(region.minX, viewRegion.minX),
- minY: Math.max(region.minY, viewRegion.minY),
- maxX: Math.min(region.maxX, viewRegion.maxX),
- maxY: Math.min(region.maxY, viewRegion.maxY),
- };
- }
- exports.mergeView = mergeView;
- /***/ }),
- /***/ "./src/util/hit.ts":
- /*!*************************!*\
- !*** ./src/util/hit.ts ***!
- \*************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.getShape = void 0;
- var util_1 = __webpack_require__(/*! @antv/g-base/lib/util/util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/util.js");
- var matrix_1 = __webpack_require__(/*! @antv/g-base/lib/util/matrix */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/matrix.js");
- function invertFromMatrix(v, matrix) {
- if (matrix) {
- var invertMatrix = matrix_1.invert(matrix);
- return matrix_1.multiplyVec2(invertMatrix, v);
- }
- return v;
- }
- function getRefXY(element, x, y) {
- // @ts-ignore
- var totalMatrix = element.getTotalMatrix();
- if (totalMatrix) {
- var _a = invertFromMatrix([x, y, 1], totalMatrix), refX = _a[0], refY = _a[1];
- return [refX, refY];
- }
- return [x, y];
- }
- // 拾取前的检测,只有通过检测才能继续拾取
- function preTest(element, x, y) {
- // @ts-ignore
- if (element.isCanvas && element.isCanvas()) {
- return true;
- }
- // 不允许被拾取,则返回 null
- // @ts-ignore
- if (!util_1.isAllowCapture(element) || element.cfg.isInView === false) {
- return false;
- }
- if (element.cfg.clipShape) {
- // 如果存在 clip
- var _a = getRefXY(element, x, y), refX = _a[0], refY = _a[1];
- if (element.isClipped(refX, refY)) {
- return false;
- }
- }
- // @ts-ignore ,这个地方调用过于频繁
- var bbox = element.cfg.cacheCanvasBBox || element.getCanvasBBox();
- // 如果没有缓存 bbox,则说明不可见
- // 注释掉的这段可能会加速拾取,上面的语句改写成 const bbox = element.cfg.cacheCanvasBBox;
- // 这时候的拾取假设图形/分组在上一次绘制都在视窗内,但是上面已经判定了 isInView 所以意义不大
- // 现在还调用 element.getCanvasBBox(); 一个很大的原因是便于单元测试
- // if (!bbox) {
- // return false;
- // }
- if (!(x >= bbox.minX && x <= bbox.maxX && y >= bbox.minY && y <= bbox.maxY)) {
- return false;
- }
- return true;
- }
- // 这个方法复写了 g-base 的 getShape
- function getShape(container, x, y) {
- // 没有通过检测,则返回 null
- if (!preTest(container, x, y)) {
- return null;
- }
- var shape = null;
- var children = container.getChildren();
- var count = children.length;
- for (var i = count - 1; i >= 0; i--) {
- var child = children[i];
- if (child.isGroup()) {
- shape = getShape(child, x, y);
- }
- else if (preTest(child, x, y)) {
- var curShape = child;
- var _a = getRefXY(child, x, y), refX = _a[0], refY = _a[1];
- // @ts-ignore
- if (curShape.isInShape(refX, refY)) {
- shape = child;
- }
- }
- if (shape) {
- break;
- }
- }
- return shape;
- }
- exports.getShape = getShape;
- /***/ }),
- /***/ "./src/util/in-path/point-in-path.ts":
- /*!*******************************************!*\
- !*** ./src/util/in-path/point-in-path.ts ***!
- \*******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var offscreen_1 = __webpack_require__(/*! @antv/g-base/lib/util/offscreen */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/offscreen.js");
- function isPointInPath(shape, x, y) {
- var ctx = offscreen_1.getOffScreenContext();
- shape.createPath(ctx);
- return ctx.isPointInPath(x, y);
- }
- exports.default = isPointInPath;
- /***/ }),
- /***/ "./src/util/in-path/polygon.ts":
- /*!*************************************!*\
- !*** ./src/util/in-path/polygon.ts ***!
- \*************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview 判断点是否在多边形内
- * @author dxq613@gmail.com
- */
- Object.defineProperty(exports, "__esModule", { value: true });
- // 多边形的射线检测,参考:https://blog.csdn.net/WilliamSun0122/article/details/77994526
- var tolerance = 1e-6;
- // 三态函数,判断两个double在eps精度下的大小关系
- function dcmp(x) {
- if (Math.abs(x) < tolerance) {
- return 0;
- }
- return x < 0 ? -1 : 1;
- }
- // 判断点Q是否在p1和p2的线段上
- function onSegment(p1, p2, q) {
- if ((q[0] - p1[0]) * (p2[1] - p1[1]) === (p2[0] - p1[0]) * (q[1] - p1[1]) &&
- Math.min(p1[0], p2[0]) <= q[0] &&
- q[0] <= Math.max(p1[0], p2[0]) &&
- Math.min(p1[1], p2[1]) <= q[1] &&
- q[1] <= Math.max(p1[1], p2[1])) {
- return true;
- }
- return false;
- }
- // 判断点P在多边形内-射线法
- function isInPolygon(points, x, y) {
- var isHit = false;
- var n = points.length;
- if (n <= 2) {
- // svg 中点小于 3 个时,不显示,也无法被拾取
- return false;
- }
- for (var i = 0; i < n; i++) {
- var p1 = points[i];
- var p2 = points[(i + 1) % n];
- if (onSegment(p1, p2, [x, y])) {
- // 点在多边形一条边上
- return true;
- }
- // 前一个判断min(p1[1],p2[1])<P.y<=max(p1[1],p2[1])
- // 后一个判断被测点 在 射线与边交点 的左边
- if (dcmp(p1[1] - y) > 0 !== dcmp(p2[1] - y) > 0 &&
- dcmp(x - ((y - p1[1]) * (p1[0] - p2[0])) / (p1[1] - p2[1]) - p1[0]) < 0) {
- isHit = !isHit;
- }
- }
- return isHit;
- }
- exports.default = isInPolygon;
- /***/ }),
- /***/ "./src/util/in-stroke/arc.ts":
- /*!***********************************!*\
- !*** ./src/util/in-stroke/arc.ts ***!
- \***********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var util_1 = __webpack_require__(/*! ../util */ "./src/util/util.ts");
- function arc(cx, cy, r, startAngle, endAngle, lineWidth, x, y) {
- var angle = (Math.atan2(y - cy, x - cx) + Math.PI * 2) % (Math.PI * 2); // 转换到 0 - 2 * Math.PI 之间
- if (angle < startAngle || angle > endAngle) {
- return false;
- }
- var point = {
- x: cx + r * Math.cos(angle),
- y: cy + r * Math.sin(angle),
- };
- return util_1.distance(point.x, point.y, x, y) <= lineWidth / 2;
- }
- exports.default = arc;
- /***/ }),
- /***/ "./src/util/in-stroke/line.ts":
- /*!************************************!*\
- !*** ./src/util/in-stroke/line.ts ***!
- \************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var line_1 = __webpack_require__(/*! @antv/g-math/lib/line */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js");
- function inLine(x1, y1, x2, y2, lineWidth, x, y) {
- var minX = Math.min(x1, x2);
- var maxX = Math.max(x1, x2);
- var minY = Math.min(y1, y2);
- var maxY = Math.max(y1, y2);
- var halfWidth = lineWidth / 2;
- // 因为目前的方案是计算点到直线的距离,而有可能会在延长线上,所以要先判断是否在包围盒内
- // 这种方案会在水平或者竖直的情况下载线的延长线上有半 lineWidth 的误差
- if (!(x >= minX - halfWidth && x <= maxX + halfWidth && y >= minY - halfWidth && y <= maxY + halfWidth)) {
- return false;
- }
- // 因为已经计算了包围盒,所以仅需要计算到直线的距离即可,可以显著提升性能
- return line_1.default.pointToLine(x1, y1, x2, y2, x, y) <= lineWidth / 2;
- }
- exports.default = inLine;
- /***/ }),
- /***/ "./src/util/in-stroke/polyline.ts":
- /*!****************************************!*\
- !*** ./src/util/in-stroke/polyline.ts ***!
- \****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var line_1 = __webpack_require__(/*! ./line */ "./src/util/in-stroke/line.ts");
- function inPolyline(points, lineWidth, x, y, isClose) {
- var count = points.length;
- if (count < 2) {
- return false;
- }
- for (var i = 0; i < count - 1; i++) {
- var x1 = points[i][0];
- var y1 = points[i][1];
- var x2 = points[i + 1][0];
- var y2 = points[i + 1][1];
- if (line_1.default(x1, y1, x2, y2, lineWidth, x, y)) {
- return true;
- }
- }
- // 如果封闭,则计算起始点和结束点的边
- if (isClose) {
- var first = points[0];
- var last = points[count - 1];
- if (line_1.default(first[0], first[1], last[0], last[1], lineWidth, x, y)) {
- return true;
- }
- }
- return false;
- }
- exports.default = inPolyline;
- /***/ }),
- /***/ "./src/util/in-stroke/rect-radius.ts":
- /*!*******************************************!*\
- !*** ./src/util/in-stroke/rect-radius.ts ***!
- \*******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var line_1 = __webpack_require__(/*! ./line */ "./src/util/in-stroke/line.ts");
- var arc_1 = __webpack_require__(/*! ./arc */ "./src/util/in-stroke/arc.ts");
- function rectWithRadius(minX, minY, width, height, radius, lineWidth, x, y) {
- var halfWidth = lineWidth / 2;
- return (line_1.default(minX + radius, minY, minX + width - radius, minY, lineWidth, x, y) ||
- line_1.default(minX + width, minY + radius, minX + width, minY + height - radius, lineWidth, x, y) ||
- line_1.default(minX + width - radius, minY + height, minX + radius, minY + height, lineWidth, x, y) ||
- line_1.default(minX, minY + height - radius, minX, minY + radius, lineWidth, x, y) ||
- arc_1.default(minX + width - radius, minY + radius, radius, 1.5 * Math.PI, 2 * Math.PI, lineWidth, x, y) ||
- arc_1.default(minX + width - radius, minY + height - radius, radius, 0, 0.5 * Math.PI, lineWidth, x, y) ||
- arc_1.default(minX + radius, minY + height - radius, radius, 0.5 * Math.PI, Math.PI, lineWidth, x, y) ||
- arc_1.default(minX + radius, minY + radius, radius, Math.PI, 1.5 * Math.PI, lineWidth, x, y));
- }
- exports.default = rectWithRadius;
- /***/ }),
- /***/ "./src/util/in-stroke/rect.ts":
- /*!************************************!*\
- !*** ./src/util/in-stroke/rect.ts ***!
- \************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var util_1 = __webpack_require__(/*! ../util */ "./src/util/util.ts");
- function inRect(minX, minY, width, height, lineWidth, x, y) {
- var halfWidth = lineWidth / 2;
- // 将四个边看做矩形来检测,比边的检测算法要快
- return (util_1.inBox(minX - halfWidth, minY - halfWidth, width, lineWidth, x, y) || // 上边
- util_1.inBox(minX + width - halfWidth, minY - halfWidth, lineWidth, height, x, y) || // 右边
- util_1.inBox(minX + halfWidth, minY + height - halfWidth, width, lineWidth, x, y) || // 下边
- util_1.inBox(minX - halfWidth, minY + halfWidth, lineWidth, height, x, y)); // 左边
- }
- exports.default = inRect;
- /***/ }),
- /***/ "./src/util/parse.ts":
- /*!***************************!*\
- !*** ./src/util/parse.ts ***!
- \***************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.parseRadius = exports.parseStyle = exports.parsePattern = exports.parseRadialGradient = exports.parseLineGradient = void 0;
- var util_1 = __webpack_require__(/*! ./util */ "./src/util/util.ts");
- var regexTags = /[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi;
- var regexDot = /[^\s\,]+/gi;
- var regexLG = /^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i;
- var regexRG = /^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i;
- var regexPR = /^p\s*\(\s*([axyn])\s*\)\s*(.*)/i;
- var regexColorStop = /[\d.]+:(#[^\s]+|[^\)]+\))/gi;
- function addStop(steps, gradient) {
- var arr = steps.match(regexColorStop);
- util_1.each(arr, function (item) {
- var itemArr = item.split(':');
- gradient.addColorStop(itemArr[0], itemArr[1]);
- });
- }
- /**
- * 将边和填充设置的颜色转换成线性渐变对象
- * @param {CanvasRenderingContext2D} context canvas 上下文
- * @param {IElement} element 图形元素
- * @param {string} gradientStr 颜色
- * @returns {any} 渐变对象
- */
- function parseLineGradient(context, element, gradientStr) {
- var arr = regexLG.exec(gradientStr);
- var angle = (parseFloat(arr[1]) % 360) * (Math.PI / 180);
- var steps = arr[2];
- var box = element.getBBox();
- var start;
- var end;
- if (angle >= 0 && angle < (1 / 2) * Math.PI) {
- start = {
- x: box.minX,
- y: box.minY,
- };
- end = {
- x: box.maxX,
- y: box.maxY,
- };
- }
- else if ((1 / 2) * Math.PI <= angle && angle < Math.PI) {
- start = {
- x: box.maxX,
- y: box.minY,
- };
- end = {
- x: box.minX,
- y: box.maxY,
- };
- }
- else if (Math.PI <= angle && angle < (3 / 2) * Math.PI) {
- start = {
- x: box.maxX,
- y: box.maxY,
- };
- end = {
- x: box.minX,
- y: box.minY,
- };
- }
- else {
- start = {
- x: box.minX,
- y: box.maxY,
- };
- end = {
- x: box.maxX,
- y: box.minY,
- };
- }
- var tanTheta = Math.tan(angle);
- var tanTheta2 = tanTheta * tanTheta;
- var x = (end.x - start.x + tanTheta * (end.y - start.y)) / (tanTheta2 + 1) + start.x;
- var y = (tanTheta * (end.x - start.x + tanTheta * (end.y - start.y))) / (tanTheta2 + 1) + start.y;
- var gradient = context.createLinearGradient(start.x, start.y, x, y);
- addStop(steps, gradient);
- return gradient;
- }
- exports.parseLineGradient = parseLineGradient;
- /**
- * 将边和填充设置的颜色转换成圆形渐变对象
- * @param {CanvasRenderingContext2D} context canvas 上下文
- * @param {IElement} element 图形元素
- * @param {string} gradientStr 颜色
- * @returns {any} 渐变对象
- */
- function parseRadialGradient(context, element, gradientStr) {
- var arr = regexRG.exec(gradientStr);
- var fx = parseFloat(arr[1]);
- var fy = parseFloat(arr[2]);
- var fr = parseFloat(arr[3]);
- var steps = arr[4];
- // 环半径为0时,默认无渐变,取渐变序列的最后一个颜色
- if (fr === 0) {
- var colors = steps.match(regexColorStop);
- return colors[colors.length - 1].split(':')[1];
- }
- var box = element.getBBox();
- var width = box.maxX - box.minX;
- var height = box.maxY - box.minY;
- var r = Math.sqrt(width * width + height * height) / 2;
- var gradient = context.createRadialGradient(box.minX + width * fx, box.minY + height * fy, 0, box.minX + width / 2, box.minY + height / 2, fr * r);
- addStop(steps, gradient);
- return gradient;
- }
- exports.parseRadialGradient = parseRadialGradient;
- /**
- * 边和填充设置的颜色转换成 pattern
- * @param {CanvasRenderingContext2D} context canvas 上下文
- * @param {IElement} element 图形元素
- * @param {string} patternStr 生成 pattern 的字符串
- */
- function parsePattern(context, element, patternStr) {
- // 在转换过程中进行了缓存
- if (element.get('patternSource') && element.get('patternSource') === patternStr) {
- return element.get('pattern');
- }
- var pattern;
- var img;
- var arr = regexPR.exec(patternStr);
- var repeat = arr[1];
- var source = arr[2];
- // Function to be called when pattern loads
- function onload() {
- // Create pattern
- pattern = context.createPattern(img, repeat);
- element.set('pattern', pattern); // be a cache
- element.set('patternSource', patternStr);
- }
- switch (repeat) {
- case 'a':
- repeat = 'repeat';
- break;
- case 'x':
- repeat = 'repeat-x';
- break;
- case 'y':
- repeat = 'repeat-y';
- break;
- case 'n':
- repeat = 'no-repeat';
- break;
- default:
- repeat = 'no-repeat';
- }
- img = new Image();
- // If source URL is not a data URL
- if (!source.match(/^data:/i)) {
- // Set crossOrigin for this image
- img.crossOrigin = 'Anonymous';
- }
- img.src = source;
- if (img.complete) {
- onload();
- }
- else {
- img.onload = onload;
- // Fix onload() bug in IE9
- img.src = img.src;
- }
- return pattern;
- }
- exports.parsePattern = parsePattern;
- function parseStyle(context, element, color) {
- if (util_1.isString(color)) {
- if (color[1] === '(' || color[2] === '(') {
- if (color[0] === 'l') {
- // regexLG.test(color)
- return parseLineGradient(context, element, color);
- }
- if (color[0] === 'r') {
- // regexRG.test(color)
- return parseRadialGradient(context, element, color);
- }
- if (color[0] === 'p') {
- // regexPR.test(color)
- return parsePattern(context, element, color);
- }
- }
- return color;
- }
- }
- exports.parseStyle = parseStyle;
- function parseRadius(radius) {
- var r1 = 0;
- var r2 = 0;
- var r3 = 0;
- var r4 = 0;
- if (util_1.isArray(radius)) {
- if (radius.length === 1) {
- r1 = r2 = r3 = r4 = radius[0];
- }
- else if (radius.length === 2) {
- r1 = r3 = radius[0];
- r2 = r4 = radius[1];
- }
- else if (radius.length === 3) {
- r1 = radius[0];
- r2 = r4 = radius[1];
- r3 = radius[2];
- }
- else {
- r1 = radius[0];
- r2 = radius[1];
- r3 = radius[2];
- r4 = radius[3];
- }
- }
- else {
- r1 = r2 = r3 = r4 = radius;
- }
- return [r1, r2, r3, r4];
- }
- exports.parseRadius = parseRadius;
- /***/ }),
- /***/ "./src/util/path.ts":
- /*!**************************!*\
- !*** ./src/util/path.ts ***!
- \**************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
- /**
- * @fileoverview path 的一些工具
- * @author dxq613@gmail.com
- */
- var g_base_1 = __webpack_require__(/*! @antv/g-base */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/index.js");
- var quadratic_1 = __webpack_require__(/*! @antv/g-math/lib/quadratic */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/quadratic.js");
- var cubic_1 = __webpack_require__(/*! @antv/g-math/lib/cubic */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/cubic.js");
- var util_1 = __webpack_require__(/*! ./util */ "./src/util/util.ts");
- var line_1 = __webpack_require__(/*! ./in-stroke/line */ "./src/util/in-stroke/line.ts");
- var arc_1 = __webpack_require__(/*! ./in-stroke/arc */ "./src/util/in-stroke/arc.ts");
- var mat3_1 = __webpack_require__(/*! @antv/matrix-util/lib/mat3 */ "./node_modules/_@antv_matrix-util@3.0.3@@antv/matrix-util/lib/mat3.js");
- var vec3 = __webpack_require__(/*! gl-matrix/vec3 */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec3.js");
- function hasArc(path) {
- var hasArc = false;
- var count = path.length;
- for (var i = 0; i < count; i++) {
- var params = path[i];
- var cmd = params[0];
- if (cmd === 'C' || cmd === 'A' || cmd === 'Q') {
- hasArc = true;
- break;
- }
- }
- return hasArc;
- }
- function isPointInStroke(segments, lineWidth, x, y) {
- var isHit = false;
- var halfWidth = lineWidth / 2;
- for (var i = 0; i < segments.length; i++) {
- var segment = segments[i];
- var currentPoint = segment.currentPoint, params = segment.params, prePoint = segment.prePoint, box = segment.box;
- // 如果在前面已经生成过包围盒,直接按照包围盒计算
- if (box && !util_1.inBox(box.x - halfWidth, box.y - halfWidth, box.width + lineWidth, box.height + lineWidth, x, y)) {
- continue;
- }
- switch (segment.command) {
- // L 和 Z 都是直线, M 不进行拾取
- case 'L':
- case 'Z':
- isHit = line_1.default(prePoint[0], prePoint[1], currentPoint[0], currentPoint[1], lineWidth, x, y);
- break;
- case 'Q':
- var qDistance = quadratic_1.default.pointDistance(prePoint[0], prePoint[1], params[1], params[2], params[3], params[4], x, y);
- isHit = qDistance <= lineWidth / 2;
- break;
- case 'C':
- var cDistance = cubic_1.default.pointDistance(prePoint[0], prePoint[1], params[1], params[2], params[3], params[4], params[5], params[6], x, y);
- isHit = cDistance <= lineWidth / 2;
- break;
- case 'A':
- // 计算点到椭圆圆弧的距离,暂时使用近似算法,后面可以改成切割法求最近距离
- var arcParams = segment.arcParams;
- var cx = arcParams.cx, cy = arcParams.cy, rx = arcParams.rx, ry = arcParams.ry, startAngle = arcParams.startAngle, endAngle = arcParams.endAngle, xRotation = arcParams.xRotation;
- var p = [x, y, 1];
- var r = rx > ry ? rx : ry;
- var scaleX = rx > ry ? 1 : rx / ry;
- var scaleY = rx > ry ? ry / rx : 1;
- var m = mat3_1.transform(null, [
- ['t', -cx, -cy],
- ['r', -xRotation],
- ['s', 1 / scaleX, 1 / scaleY],
- ]);
- vec3.transformMat3(p, p, m);
- isHit = arc_1.default(0, 0, r, startAngle, endAngle, lineWidth, p[0], p[1]);
- break;
- default:
- break;
- }
- if (isHit) {
- break;
- }
- }
- return isHit;
- }
- /**
- * 提取出内部的闭合多边形和非闭合的多边形,假设 path 不存在圆弧
- * @param {Array} path 路径
- * @returns {Array} 点的集合
- */
- function extractPolygons(path) {
- var count = path.length;
- var polygons = [];
- var polylines = [];
- var points = []; // 防止第一个命令不是 'M'
- for (var i = 0; i < count; i++) {
- var params = path[i];
- var cmd = params[0];
- if (cmd === 'M') {
- // 遇到 'M' 判定是否是新数组,新数组中没有点
- if (points.length) {
- // 如果存在点,则说明没有遇到 'Z',开始了一个新的多边形
- polylines.push(points);
- points = []; // 创建新的点
- }
- points.push([params[1], params[2]]);
- }
- else if (cmd === 'Z') {
- if (points.length) {
- // 存在点
- polygons.push(points);
- points = []; // 开始新的点集合
- }
- // 如果不存在点,同时 'Z',则说明是错误,不处理
- }
- else {
- points.push([params[1], params[2]]);
- }
- }
- // 说明 points 未放入 polygons 或者 polyline
- // 仅当只有一个 M,没有 Z 时会发生这种情况
- if (points.length > 0) {
- polylines.push(points);
- }
- return {
- polygons: polygons,
- polylines: polylines,
- };
- }
- exports.default = tslib_1.__assign({ hasArc: hasArc,
- extractPolygons: extractPolygons,
- isPointInStroke: isPointInStroke }, g_base_1.PathUtil);
- /***/ }),
- /***/ "./src/util/util.ts":
- /*!**************************!*\
- !*** ./src/util/util.ts ***!
- \**************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.isSamePoint = exports.mergeRegion = exports.intersectRect = exports.inBox = exports.distance = exports.getPixelRatio = void 0;
- function getPixelRatio() {
- return window ? window.devicePixelRatio : 1;
- }
- exports.getPixelRatio = getPixelRatio;
- /**
- * 两点之间的距离
- * @param {number} x1 起始点 x
- * @param {number} y1 起始点 y
- * @param {number} x2 结束点 x
- * @param {number} y2 结束点 y
- */
- function distance(x1, y1, x2, y2) {
- var dx = x1 - x2;
- var dy = y1 - y2;
- return Math.sqrt(dx * dx + dy * dy);
- }
- exports.distance = distance;
- /**
- * 是否在包围盒内
- * @param {number} minX 包围盒开始的点 x
- * @param {number} minY 包围盒开始的点 y
- * @param {number} width 宽度
- * @param {number} height 高度
- * @param {[type]} x 检测点的 x
- * @param {[type]} y 监测点的 y
- */
- function inBox(minX, minY, width, height, x, y) {
- return x >= minX && x <= minX + width && y >= minY && y <= minY + height;
- }
- exports.inBox = inBox;
- function intersectRect(box1, box2) {
- return !(box2.minX > box1.maxX || box2.maxX < box1.minX || box2.minY > box1.maxY || box2.maxY < box1.minY);
- }
- exports.intersectRect = intersectRect;
- // 合并两个区域
- function mergeRegion(region1, region2) {
- if (!region1 || !region2) {
- return region1 || region2;
- }
- return {
- minX: Math.min(region1.minX, region2.minX),
- minY: Math.min(region1.minY, region2.minY),
- maxX: Math.max(region1.maxX, region2.maxX),
- maxY: Math.max(region1.maxY, region2.maxY),
- };
- }
- exports.mergeRegion = mergeRegion;
- /**
- * 判断两个点是否重合,点坐标的格式为 [x, y]
- * @param {Array} point1 第一个点
- * @param {Array} point2 第二个点
- */
- function isSamePoint(point1, point2) {
- return point1[0] === point2[0] && point1[1] === point2[1];
- }
- exports.isSamePoint = isSamePoint;
- var is_nil_1 = __webpack_require__(/*! @antv/util/lib/is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
- Object.defineProperty(exports, "isNil", { enumerable: true, get: function () { return is_nil_1.default; } });
- var is_string_1 = __webpack_require__(/*! @antv/util/lib/is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js");
- Object.defineProperty(exports, "isString", { enumerable: true, get: function () { return is_string_1.default; } });
- var is_function_1 = __webpack_require__(/*! @antv/util/lib/is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
- Object.defineProperty(exports, "isFunction", { enumerable: true, get: function () { return is_function_1.default; } });
- var is_array_1 = __webpack_require__(/*! @antv/util/lib/is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
- Object.defineProperty(exports, "isArray", { enumerable: true, get: function () { return is_array_1.default; } });
- var each_1 = __webpack_require__(/*! @antv/util/lib/each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
- Object.defineProperty(exports, "each", { enumerable: true, get: function () { return each_1.default; } });
- var to_radian_1 = __webpack_require__(/*! @antv/util/lib/to-radian */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-radian.js");
- Object.defineProperty(exports, "toRadian", { enumerable: true, get: function () { return to_radian_1.default; } });
- var mod_1 = __webpack_require__(/*! @antv/util/lib/mod */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mod.js");
- Object.defineProperty(exports, "mod", { enumerable: true, get: function () { return mod_1.default; } });
- var is_number_equal_1 = __webpack_require__(/*! @antv/util/lib/is-number-equal */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number-equal.js");
- Object.defineProperty(exports, "isNumberEqual", { enumerable: true, get: function () { return is_number_equal_1.default; } });
- var request_animation_frame_1 = __webpack_require__(/*! @antv/util/lib/request-animation-frame */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/request-animation-frame.js");
- Object.defineProperty(exports, "requestAnimationFrame", { enumerable: true, get: function () { return request_animation_frame_1.default; } });
- var clear_animation_frame_1 = __webpack_require__(/*! @antv/util/lib/clear-animation-frame */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/clear-animation-frame.js");
- Object.defineProperty(exports, "clearAnimationFrame", { enumerable: true, get: function () { return clear_animation_frame_1.default; } });
- /***/ })
- /******/ });
- });
- //# sourceMappingURL=g.min.js.map
|